I'm trying to make a simple 'kill command' in Roblox Studio where you type ";kill player" and it will kill them.
The part I am struggling with is how on earth to separate the words before and after the space, and store them as variables?
Steps I need in my code:
- Check if the message deliverer's name is equal to the value of 'Owner'
- Check if the message contains ';' at the beginning (the prefix)
- Check if the message contains one space
- If all of the above are true, Then set the word before the space to the variable,'cmd' and set the word after the space to the variable, 'username'.
The rest I can figure out on my own.
Here's what my code is currently:
local Owner = "Djraco"
local Prefix = ";"
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
--<code goes here>
end)
end)
Thanks in advance!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…