Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with this script?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

It does not work via an error.

local Saying = game.Players.Chatted:connect()

if Saying.msg:sub(1,5) "kill " then
    vic = msg:sub(1,9)
    vic:WaitforChild("Character")
elseif vic:BreakJoints() then
vic.Character.Health = 0
end -- No problem here just in Developer Thing it says That Chatted is not a valid member of Players

1 answer

Log in to vote
0
Answered by 10 years ago
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
--stuff
--stuff
end)
end)

check out this wiki:http://wiki.roblox.com/index.php?title=Using_the_Chatted_event this one too:http://wiki.roblox.com/index.php?title=Conditional_statement you missed the == sign for the if statement

Ad

Answer this question