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

Why this Local script not working? [UNSOLVED]

This script is uses to remove startergear when i say !end then respawns ALL the characters. The script is broken for some reason but I don't know why? Both the respawn and starttool removed doesn't work.

names = {"GTDRIVER"}	-- Add in the names of the people you want to be able to use the command script here.}

game.Players.PlayerAdded:connect(function(player)
for i, v in pairs(names) do
if v == player.Name then
player.Chatted:connect(function(chatmsg)
if chatmsg:sub(1,4) == "!end" then
local tool = chatmsg:sub(5, chatmsg:len())
if game.Players.LocalPlayer ~= nil then
	game.Players.LocalPlayer.StarterGear:remove()
script:remove() 
end
end
end)
end
end
end)

if msg:lower():sub(1,4) == "!end" then
local plrz = GetPlr(plr, msg:lower():sub(5))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v and v.Character then v:LoadCharacter() end
end))
end
end

1 answer

On line 9 and 10, use player instead of game.Players.LocalPlayer

1 comment

0

Still nothing works.

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