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

Help with my Admin Commands?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

I have tried to Fix this, as in Using different Methods, Such as or, but I thought you guys should see the source of the Problem And See if I am Missing anything.

Replicants = {"amegaman","papertiger67"}

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" or "@message" then
Text("This is a message!",4,workspace,"Message")
end

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

For The Message it Says "This is a Message!" and Than the Actual Message.

2 answers

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago
if msg:lower()=="@m" or "@message" then

You are using or incorrectly. It should be,

msg:lower()=="@m" or msg:lower() == "@message" then
if msg:lower():sub(1,3)=="@m/"or "@message/" then

First, it would probably be better to do elseif. Second, :sub(1,3) means the first three characters, so it would only work for @m/. And of course, the same problem as before. I would do this:

elseif msg:lower():sub(1,3) == "@m/" or msg:lower():sub(1,9) == "@message/" then

Hope i helped!

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

Check out this video it works in the same way:- http://www.youtube.com/watch?v=kBXXiEUbKTA&list=PL07EDADFC98AE6A54

Answer this question