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

Please help with this script. It doesn't error but it doesn't work. What is the problem with it?

Asked by 10 years ago
Permission = {"andrewboy159","PLAYER","PLAYER"} 
RunText = "/computer run obby2"
StopText = "/computer stop obby2"
Map = "Obby2" 

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

1 answer

Log in to vote
0
Answered by 10 years ago

Heres my old MESSY code for Slender House minigames.

I used to use this script for Slender House its old and a bit messy code but fine for beginner's.

while true do
script.Parent.L1.SoundId = "rbxassetid://159564304"
script.Parent.L1:Play()
wait(10)
--local player = game.Players:GetPlayers()
local player = game:GetService("Players"):GetPlayers()
print("Got Players")
for i = 1, #player do 
print("Have Players")
game.Lighting.Minigame1:clone().Parent = game.Workspace
wait(15)
print("Teleporting Players To Map")
player[i].Character:MoveTo(Vector3.new(2742.16, 919.19, -433.668))
script.Parent.L1:Pause()
script.Parent.M1:Play()
script.Parent.L1.SoundId = "rbxassetid://144652376"
wait(60)
game.Workspace.Minigame1:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M1:Pause()
script.Parent.L1.SoundId = "rbxassetid://165854869"
script.Parent.L1:Play()
wait(20)--Lobby time
game.Lighting.Minigame2:clone().Parent = game.Workspace
wait(15)
player[i].Character:MoveTo(Vector3.new(236.128, 79.66, -167.719))
script.Parent.L1:Pause()
script.Parent.M2:Play()
wait(60)
game.Workspace.Minigame2:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M2:Pause()
script.Parent.L1.SoundId = "rbxassetid://166349101"
script.Parent.L1:Play()
wait(20)--Lobby time
game.Lighting.Minigame3:clone().Parent = game.Workspace
wait(20)
player[i].Character:MoveTo(Vector3.new(2818.731, 863.74, -348.36))
script.Parent.L1:Pause()
script.Parent.M3:Play()
wait(60)
game.Workspace.Minigame3:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M3:Pause()
script.Parent.L1.SoundId = "rbxassetid://160652910"
script.Parent.L1:Play()
wait(30)--Lobby time
game.Lighting.Minigame4:clone().Parent = game.Workspace
wait(15)
player[i].Character:MoveTo(Vector3.new(2890.738, 918.795, -556.728))
script.Parent.L1:Pause()
script.Parent.M4:Play()
wait(60)
game.Workspace.Minigame4:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M4:Pause()
script.Parent.L1.SoundId = "rbxassetid://131395268"
script.Parent.L1:Play()
wait(20)--Lobby time
game.Lighting.Minigame5:clone().Parent = game.Workspace
wait(15)
player[i].Character:MoveTo(Vector3.new(341.17, 110.829, -528.191))
script.Parent.L1:Pause()
script.Parent.M5:Play()
wait(60)
game.Workspace.Minigame5:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M5:Pause()
script.Parent.L1.SoundId = "rbxassetid://145262991"
script.Parent.L1:Play()
wait(20)--Lobby time
game.Lighting.Minigame6:clone().Parent = game.Workspace
wait(15)
player[i].Character:MoveTo(Vector3.new(516.016, 123.344, -536.515))
script.Parent.L1:Pause()
script.Parent.M6:Play()
wait(60)
game.Workspace.Minigame6:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M6:Pause()
script.Parent.L1.SoundId = "rbxassetid://142278786"
script.Parent.L1:Play()
wait(20)--Lobby time
script.Parent.M7.Volume = 1
game.Lighting.Minigame7:clone().Parent = game.Workspace
wait(15)
player[i].Character:MoveTo(Vector3.new(2857.187, 919.461, -529.281))
script.Parent.L1:Pause()
script.Parent.M7:Play()
wait(60)
game.Workspace.Minigame7:Remove()
player[i].Character:MoveTo(Vector3.new(2058.5, 808.665, -467.594))
script.Parent.M7:Pause()
end
end`

OR

replace game.Lighting.Minigame1:Clone().Parent = game.Workspace WITH game:GetService("Lighting").Minigame1:Clone().Parent=game.Workspace

Done.

0
Are you sure this will work? and if so should I keep the "--[[Function Start]]--" and "--[[Function Find]]--"? i'm sorry, I just don't understand andrewboy159 18 — 10y
0
The function start and function find is a comment.Comments aren't read in the script. iluvmaths1123 198 — 10y
0
thank you guys you've been a real help. but jillmiles1, in this script you have: then if Game:GetService and other stuff, but you don't have a then in it. won't that error? andrewboy159 18 — 10y
0
and you just have Workspace instead of game.Workspace andrewboy159 18 — 10y
View all comments (3 more)
0
jillmiles your script doesn't work andrewboy159 18 — 10y
0
i just tried it andrewboy159 18 — 10y
0
Now you may edit that script I just re-posted. Theres some good beginner code in it. jillmiles1 3 — 10y
Ad

Answer this question