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

How do you say a certain word and change an object's property?

I need help on a script command. I'm a terrible scripter. I need a command where when I say a certain word, it changes the brick color. Also only people w/ permission are allowed to do that command.

1 comment

0

Scripting Helpers in not a Request Site; You must first attempt to make the code yourself, we can not make scripts for you (unless we give examples of some-sort of code).

1 answer

Here are a few snippets that you need

Game.Players.PlayerAdded:connect(function(NewPlayer)
NewPlayer.Chatted:connect(function(Message)
if string.lower(string.sub(Message, 1, 4)) == 'kill' then
-- Do action
end
end)
end)

Basically what we are doing :

  • Listen or there is a new Player that joins the game
  • Every single time he starts talking we are listing what he is saying.
  • On Line 3 we take that message, and only listen to the first 4 Characters and convert that to all lowercase characters so that it doesn't matter or you say 'Kill' or 'KILL' or 'KiLL'.
  • If that message is correct we execute the action (Fill in your code on Line 4)

Admin list :

  • Learn how to work with Tables (See the Wiki) to understand how you should be able to make an admin table.

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