Solved Chat commands with skript

  • 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 comminuty!

    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.
Nov 11, 2021
13
0
1
22
I wanted to make a spoofing system without the need for commands by just typing in the chat, as if it were a conversation between an npc and the player, for example:

(command /toggle)
NPC: Well let's start with your name, write it down in the chat "
* the player writes a word in the chat *
NPC: Well your new fake name is (word the player wrote)

And so with the genre too, I have been seeing many methods putting variables, I know that you have to use the "on chat", but I really don't know how to use two, I mean, if it came out with the name but not with the genre, I wanted to do something like this:
 
The easiest solution is probably with variables:
Code:
command /changename:
  trigger:
    send "Mighty Wizard: What's your name? Tell me in the chat."
    set {-changename::%player%} to true

on chat:
  if {-changename::%player%} is true:
    cancel event
    clear {-changename::%player%}
    set {name::%player%} to message
    send "Mighty Wizard: Your new name, %message%, is enchanting!"
    #Your code may continue here
You might also want to cancel this if the player leaves...
Code:
on quit:
  if {-changename::%player%} is set:
    clear {-changename::%player%}
 
The easiest solution is probably with variables:
Code:
command /changename:
  trigger:
    send "Mighty Wizard: What's your name? Tell me in the chat."
    set {-changename::%player%} to true

on chat:
  if {-changename::%player%} is true:
    cancel event
    clear {-changename::%player%}
    set {name::%player%} to message
    send "Mighty Wizard: Your new name, %message%, is enchanting!"
    #Your code may continue here
You might also want to cancel this if the player leaves...
Code:
on quit:
  if {-changename::%player%} is set:
    clear {-changename::%player%}
thank you, you helped me a lot
 
Status
Not open for further replies.