Never C&P for a script...How do I fix this?
GroupId = 947529 --Group Id goes here Rank = plr:GetRankInGroup(GroupId) --Nothing needs to be edited here local door=script.Parent game.Players.PlayerAdded:connect(function(p) if Rank >= 9 then function ChkEpic(name) for i = 1, #Admins do if Admins[i]:lower() == name:lower() then return true end end return false end function CloseSim() if currsim ~= nil then laser.Color = BrickColor.new("Institutional white") for i, v in ipairs(currsim:children()) do if v:IsA("BasePart") then laser.Part = v local ex = Instance.new("Explosion", game.Workspace) ex.BlastRadius = 1 ex.BlastPressure = 0 ex.Position = v.Position wait() v:Destroy() end end laser.Part = nil currsim:Destroy() currsim = nil end end function RunSim(sim) for _, v in ipairs(game.Lighting.Simulations:children()) do if v.Name:lower() == sim:lower() then local mod = Instance.new("Model", game.Workspace) currsim = mod mod.Name = v.Name laser.Color = BrickColor.new("Institutional white") for i, part in ipairs(v:children()) do if part:IsA("BasePart") then local cl = part:Clone() cl.Parent = mod laser.Part = cl mod:MakeJoints() wait() end end laser.Part = nil end end end for i, plr in ipairs(game.Players:children()) do plr.Chatted:connect(function(msg) if msg:lower():sub(1,5) == "Computer start" then CloseSim() RunSim(msg:lower():sub(6)) elseif msg:lower() == "Computer end" then CloseSim() end end) end game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) if ChkEpic(plr.Name) == true then if msg:lower():sub(1,5) == "Computer start" then CloseSim() RunSim(msg:lower():sub(6)) elseif msg:lower() == "Compter end" then CloseSim() end end end) end)
You didn't need the
local door=script.Parent game.Players.PlayerAdded:connect(function(p)
So i removed it for you and you are left with this.
GroupId = 947529 --Group Id goes here Rank = plr:GetRankInGroup(GroupId) --Nothing needs to be edited here if Rank >= 9 then function ChkEpic(name) for i = 1, #Admins do if Admins[i]:lower() == name:lower() then return true end end return false end function CloseSim() if currsim ~= nil then laser.Color = BrickColor.new("Institutional white") for i, v in ipairs(currsim:children()) do if v:IsA("BasePart") then laser.Part = v local ex = Instance.new("Explosion", game.Workspace) ex.BlastRadius = 1 ex.BlastPressure = 0 ex.Position = v.Position wait() v:Destroy() end end laser.Part = nil currsim:Destroy() currsim = nil end end function RunSim(sim) for _, v in ipairs(game.Lighting.Simulations:children()) do if v.Name:lower() == sim:lower() then local mod = Instance.new("Model", game.Workspace) currsim = mod mod.Name = v.Name laser.Color = BrickColor.new("Institutional white") for i, part in ipairs(v:children()) do if part:IsA("BasePart") then local cl = part:Clone() cl.Parent = mod laser.Part = cl mod:MakeJoints() wait() end end laser.Part = nil end end end for i, plr in ipairs(game.Players:children()) do plr.Chatted:connect(function(msg) if msg:lower():sub(1,5) == "Computer start" then CloseSim() RunSim(msg:lower():sub(6)) elseif msg:lower() == "Computer end" then CloseSim() end end) end game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) if ChkEpic(plr.Name) == true then if msg:lower():sub(1,5) == "Computer start" then CloseSim() RunSim(msg:lower():sub(6)) elseif msg:lower() == "Compter end" then CloseSim() end end end) end)