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

What is wrong with my @Name Command?

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.

5 comments

0

What is wrong? Is this the entirety of the script? What errors are there? What have YOU done to debug???

0

There are no errors, It just Does not Work.

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.

0

Error typo: For line 34 change then:sub(1,3) to :sub(1,6)

0

*change the :sub(1,3) to :sub(1,6). So many typos. ;-;

1 answer

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

1 comment

0

You need a certain reputation to comment on people's post that aren't yours.

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