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

Arguments for Chatted?

Asked by 10 years ago

What arguments can be used for the Chatted event? Also, is there an easier way to write this?

game.Players.PlayerAdded:connect(function (Pname)
    game.Players.Chatted:connect(function (msg,rec)

    end)
end)

2 answers

Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

Nope, there is no easier way, that is actually the easiest way IMO. You can have the script reset a person on command.

game.Players.PlayerAdded:connect(function (Pname)
    game.Players.Chatted:connect(function (msg,rec)
    if msg:lower() == "reset" then
        Pname.Character:BreakJoints()
    end
    end)
end)

Although I don't understand the Instance portion of the event. It says right here in the ROBLOX wiki; Chatted ( String message, Instance recipient )

Ad
Log in to vote
0
Answered by 10 years ago

This is kind of like an admin script, I hope it helps in what you are talking about.

admins={"Name Here"}

function oc(msg)

if msg=="cmds"then
print("nil")
end
end

game.Players.PlayerAdded:connect(function(ack)
if ack~=nil then --If player exists
for i=1,#admins do
if string.lower(ack.Name)==string.lower(admins[i])then
ack.Chatted:connect(oc)
end end end end)

Answer this question