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

What is wrong with my @m admin command?

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.
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.

0
Could you put this in a code block? Also, what line is the problem on? GoldenPhysics 474 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

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!

Ad
Log in to vote
-1
Answered by 10 years ago

Or just add another Parentheses at the end off line 11

0
I had tried that Already, only gave another error. IcyEvil 260 — 10y

Answer this question