Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is wrong with my @m admin command?

Replicants = {"amegaman"}

game.Players.PlayerAdded:connect(function(plr)
for i,v in pairs(Replicants)do
if plr.Name:lower()==v:lower()then
plr.Chatted:connect(function(msg)
m = Instance.new("Message", game.Lighting)
if plr.msg.Text == "@m "
then game.Lighting.m:Clone().Parent = game.Workspace
wait(5.0)
end
end)
end) -- Unexpected symbol near ')'
end)

There.

1 comment

0

Could you put this in a code block? Also, what line is the problem on?

2 answers

✓ Accepted answer

Hmm, try this instead;

Replicants = {"amegaman"}

function Text(text,time,par,Texttype)
local m=Instance.new(Texttype)
m.Parent=par
m.Text=text
wait(time)
if m~=nil then
m:Destroy()
end
end

game.Players.PlayerAdded:connect(function(plr)
for i,v in pairs(Replicants)do
if plr.Name:lower()==v:lower()then
plr.Chatted:connect(function(msg)

if msg:lower()=="@m"then
Text("This is a message!",4,workspace,"Message")
end

if msg:lower():sub(1,3)=="@m/"then
Text(plr.Name..": "..msg:sub(4),4,workspace,"Message")
end

end)
end
end
end)

Hope this helped!

Or just add another Parentheses at the end off line 11

1 comment

0

I had tried that Already, only gave another error.

This discussion is preserved as it was. New answers, comments, and votes are closed.