Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to create /sync command?

So basically, I was in a game that had a /sync command. With this command, you could sync the dance with another one. For Example: /sync UserXYZ. Then, you would sync with that User. Now the question is, how can I create such a command?

2 comments

0

is it r6 or r15?

0

R15. The dances are R15.

1 answer

To make a command you will need to use the player.Chatted event and :split() method.

local player = game.PLayers.LocalPlayer

player.Chatted:Connect(function(message)
	local chatTable = message:split(" ") --//Will split the message everytime it spots a space looks like this {"/sync", "Player1"}
	if chatTable[1] = "/sync" then
		local playerName = chatTable[2]
		--//Now we know what player to sync with
	end
end)

This is how to make the command and how to know what player to sync with.

Watch AlvinBlox's video on how to make commands

6 comments

0

Thanks @kingblaze_1000 for your answer!

0

No Problem @TheDoorToTheLion I hop it helped you.

0

Wait where do I have to put that script or is it a localscript? Because it doesn't seem to work, do I have to add something?

0

It is a local script. You can't use game.Players.LocalPlayer in a server script

0

Also maybe put it in StarterPack. If you don't know where local scripts will work then they work in the starter things i.e. starter character or starter Gui

0

It still doesn't work sadly... I don't have to add anything else? Just put this text into a Localscript and put that script into the Startpack?

This discussion is preserved as it was. New answers, comments, and votes are closed.