|
| 05 Mar 2015 07:00 PM |
I want a brick to go from Green to Yellow to Red... When someone says "Start" On times of 0.5
Light1 = script.Parent.Light1
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name) msg = string.lower(msg)
if (msg == "start") then wait(2) Light1.BrickColor = BrickColor.New("1004") wait(3) Light1.BrickColor = BrickColor.New("1020") wait(5)
Light1.BrickColor = BrickColor.New("21") Light1.BrickColor = BrickColor.New("37") wait(10) end
end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered)
R$267 Tx329 |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2015 07:03 PM |
Ill pay 17 R$ for it.
Its an easy script.
R$267 Tx329 |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Mar 2015 07:09 PM |
So sometimes players load before scripts
put this at the end then try it
for i, v in pairs(game.Players;GetChildren()) do onPlayerEntered(v) end |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2015 07:11 PM |
Players:GetChildren()
sorry |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 05 Mar 2015 07:19 PM |
Light1 = script.Parent.Light1
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name) msg = string.lower(msg)
if (msg == "start") then wait(2) Light1.BrickColor = BrickColor.New("1004") wait(3) Light1.BrickColor = BrickColor.New("1020") wait(5)
Light1.BrickColor = BrickColor.New("21") Light1.BrickColor = BrickColor.New("37") wait(10) end
end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.PlayerAdded:connect(function() game.Players.ChildAdded:connect(onPlayerEntered) end)
Try
R$697 Don't mess with me! I know karate, taekwando, jijutsu and 50 other dangerous words! |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2015 07:19 PM |
Sorry, mistake game.Players.CharacterAdded:connect(onPlayerEntered)
R$697 Don't mess with me! I know karate, taekwando, jijutsu and 50 other dangerous words! |
|
|
| Report Abuse |
|
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 05 Mar 2015 07:32 PM |
local db = false local function start() wait(2) Light1.BrickColor = BrickColor.New("1004") wait(3) Light1.BrickColor = BrickColor.New("1020") wait(5) Light1.BrickColor = BrickColor.New("21") Light1.BrickColor = BrickColor.New("37") wait(10) end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg:lower() == "start" then if not db then db = true start() db = false end end end) end) |
|
|
| Report Abuse |
|
|