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

Why this Local script not working? [UNSOLVED]

Asked by 9 years ago

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

Log in to vote
0
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

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

0
Still nothing works. GTDRIVER 5 — 9y
Ad

Answer this question