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)

2 comments
Is this the full script? If not, the reason it isn't working is most likely because "plr" on line 3 is being called as a variable, but hasn't been set to anything yet.
This is the full script. I have no idea how to make it to where group HR's can call a map...i just copied and pasted from another :/