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