Solved First click

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Flajakay

Active Member
Jul 29, 2018
55
1
8
Dnepr, Ukraine
When player click on npc at the first time, he will get messege with some text, and on the next click he will get another message.
How can i do it?
 
When player click on npc at the first time, he will get messege with some text, and on the next click he will get another message.
How can i do it?
code_language.skript:
on rightclick on a villager:
      if {clicked.%player%} is not true:
            set {clicked.%player%} to true
            send "&cYou clicked me first time"
      else:
            send "&cThat was not the first time you clicked me"
You can do it adding +1 to a variable when the players clicks it:
code_language.skript:
on rightclick on a villager:
      if {clicks.%player%} is not set:
            set {clicks.%player%} to 0
            wait 1 tick
            add 1 to {clicks.%player%}
            send "You clicked first time"
      else:
            add 1 to {clicks.%player%}
            #You can test how much time the player clicked it like this:
            if {clicks.%player%} is 5:
                  send "You clicked me 5 times! omg what do you want!"
 
  • Like
Reactions: Flajakay
Status
Not open for further replies.