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

Why is my script not working?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

This is sort of like an admin command but it isnt admin, it is a calculator type thing.

Script Below

game.Players.PlayerAdded:connect(function()
    for i,v in pairs(game.Players:GetChildren()) do
        v.Chatted:connect(function(msg)
        if msg:lower():sub(1,5) == "math " then
            m = Instance.new("Message")
        elseif v.Chatted == "math 0 + 1 = "
            then m.Parent = game.Workspace
            m.Text = ("1")

end
end)
end
end)

1 answer

Log in to vote
0
Answered by
RedCombee 585 Moderation Voter
9 years ago

On line 3, you have:

v.Chatted:connect()

What is the connect function connecting? I think you're looking for:

v.Chatted:connect(function(msg)
0
Thanks, Ill try it out. IcyEvil 260 — 9y
0
Still didnt work, A message didnt appear saying 1, But I did add your line of code to the script. IcyEvil 260 — 9y
Ad

Answer this question