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

Plz help me with this script. what have i done wrong?

--------------------------------------------
--        Original Creator Is Not Me      --
--    But I Kinda Changed The Whole Thing --
--        Put The Script In The Map       --
--           Change This Script           --
--------------------------------------------

Permission = {"andrewboy159","PLAYER","PLAYER"} -- Players who can run the map.
RunText = "/computer run obby2" -- Text the Players have to say to run the map.
StopText = "/computer stop obby2" -- Text the Players have to say to stop the map.
Map = "Obby2" -- The name of the map in ServerStorage.

game.Players.ChildAdded:connect(function(Player)
Player.Chatted:connect(function(Chat)
local function OnChatted()
for i = 1, #Permission do
if Player.Name == Permission[i] then
if string.lower(Chat) == RunText then
if not game.Workspace:FindFirstChild("Obby2") then
game.ServerStorage.Obby2:Clone().Parent = game.Workspace
elseif string.lower(Chat) == StopText then
if game.Workspace:FindFirstChild(Map) then
game.Workspace[Map]:Remove()
end

game.Players.PlayerAdded:connect(function(Player)
    Player.Chatted:connect(function(Chat) local onChatted(Chat, Player) end)
end)
end
end
end
end
end
end)
end)

1 comment

0

Please is spelled p-l-e-a-s-e not p-l-z.

1 answer

Tab your code. It's hard to know what exactly it's doing if you don't.

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