I have made an event and I want it so that it makes the player run a command that does something serverside, is there a way to make a player run a command or is there a different way to do a client to server interaction?
Announcement
Collapse
No announcement yet.
Making a player run a chat command
Collapse
This topic is closed.
X
X
-
From what i've seen, I haven't personally been able to purchase the game and play around with the functions they have made, however from experience I know RemoteEvents are used for client > server communications, but the things done in chat is server-sided anyways, so all you'd have to do is run code like this on a server file
Code:function HelloCommand(plr) AddPlayerChat(plr, "Hello there "..GetPlayerName(plr)) end AddCommand("hello", HelloCommand)
-
Hey,
Use the event in the link below to create a command that a player can use to trigger a function.
https://dev.playonset.com/wiki/AddCommand
LG
Mastarkill
Comment
-
This is very much possible, as I stated above you can use remote events
https://dev.playonset.com/wiki/AddRemoteEvent
https://dev.playonset.com/wiki/CallRemoteEvent
Then all you really would need to do, is just have the function that the chat command would do, run when the remote is called
Comment
-
Originally posted by flyingpigbaby View PostI mean making the player run the chat command automatically. e.g. the player clicks a button and then it makes them say a chat command.
Comment
Comment