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

What is wrong with my @Name Command?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Im making an Admin script And I want to be able to Name the Players, any Help?

function Name(plr,text,time,par,Texttype)
plr.Name.Text=text
wait(time)
end
if msg:lower()=="@m"then
    Text("BlahBlahking230",4,plr,"Name")
end

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

The entire script is

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

function Name(plr,text,time,par,Texttype)
plr.Name.Text=text
wait(time)
end
if msg:lower()=="@m"then
    Text("BlahBlahking230",4,plr,"Name")
end

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

There is No error, but It Doesn't Work.

0
What is wrong? Is this the entirety of the script? What errors are there? What have YOU done to debug??? BlueTaslem 18071 — 10y
0
There are no errors, It just Does not Work. IcyEvil 260 — 10y
0
Well, first remove lines 26-29, then for line 34 change the :sub(1,3) to 6, line 35 the msg:sub(4)to msg:sub(7), and ("Name") to a Hint or Message. TheeDeathCaster 2368 — 10y
0
Error typo: For line 34 change then:sub(1,3) to :sub(1,6) TheeDeathCaster 2368 — 10y
0
*change the :sub(1,3) to :sub(1,6). So many typos. ;-; TheeDeathCaster 2368 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

You should probably put the Variables you used somewhere in the code. (I only put this in an answer because for some reason I can't comment.)

0
You need a certain reputation to comment on people's post that aren't yours. Gamenew09 180 — 10y
Ad

Answer this question