I Can't Get A Player To Be Forced To Execute A Command.

  • 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.

Fadik2003

Member
Jul 22, 2017
1
0
0
27
Can you please hep me ? So I am having trouble with getting a player to be forced to execute a command that is triggered by an event or a loop so for example I have an NPC and I coded a script to where an event is triggered when this specific NPC is clicked here is my block of code :

on right click on player:
if name of clicked player is "&e&lCommand":
cancel the event

I just don't know what to add next to make it so that when that player or NPC is rightclicked the player who rightclicked is gonna be forced to execute a specific command, I tried:

make player execute command "/command1"


But it keeps giving me an error in the chat when I save and try to reload the script. But when I remove this specific line of code it stops giving me the problem so that's how i made sure that it wasn't something else, and also I know that the first block of code I gave has no errors by making it so that it opens a gui and formats some item in, I just can't get it to force a player to execute a specific command can someone please help me with that, thank you so much for reading my Thread.
[doublepost=1500684935,1500684754][/doublepost]In the thread above in the first block of code, I tried to make the lines spaced out same as in my text editor but it keeps putting them back together.
 
If you click the little box with a plus sign next to the video button on the default text editor here, you can insert code.

Anyways, I'm assuming you're using Citizens for npc stuffs, in which case SkRayFall has npc clicking events, which you should use instead of "on right click on player:"

code_language.skript:
on npc right click:
    if citizen is named "&e&lCommand":
        make player execute command "/command1" 
        cancel the event
 
Status
Not open for further replies.