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

Why wont the chatted event work? Its not even printing msg? (Thank you if you reply)

Asked by 4 years ago

local Admins = {"andrewplayer", "SarnikZorion1", "xBlitzIV", "JoJoParkerx"} local command = "/r" function TeleportPlayer(Torso) if not Torso then return end if Torso then Torso.CFrame = CFrame.new(script.Parent.CFrame * CFrame.new(0, 5, 0)) end end function Check(playerName) for i = 1, #Admins do if string.upper(Admins[i]) == playerName then return true end end end game.Players.PlayerAdded:Connect(function(player) local source = string.upper(player.Name) Check(source) if Check() == true then player.Chatted:Connect(function(msg) print(msg) end) end end)
0
Nothing is working because you aren't connecting your functions, lets say `function TeleportPlayer(Torso)`. You have to define what the function is, like what you did on line 22. matiss112233 258 — 4y
0
and your print on line 27 isnt in " " matiss112233 258 — 4y
0
I tried that, but it still isnt working andrewplayer 0 — 4y
0
You aren't using your functions correctly. It should be if Check(source) == true then, because doing Check() doesn't do anything as you're not filling in your parameter, and doing Check(source) is just returning true, and you're not checking anything. killerbrenden 1537 — 4y
View all comments (2 more)
0
You don't need line 24, you need to change line 25 to if Check(source) == true then killerbrenden 1537 — 4y
0
It worked, i changed it to check(source) in the if statement, thank you! andrewplayer 0 — 4y

Answer this question