So I am trying to make a script that allows the player to open the gate if the are on the correct team I tried making the script myself but it didn't work. Here's the script:
of = script.Parent.onoff
db = false
if player.humanoid.team = NorthKorea---Doesn't work
script.Parent.Open.TouchDetector.Ontouch:connect(function()---Doesn't Work
if db == false then
if of.Value == true then
db = true
for i = 0, 60, 1 do
script.Parent.Move.CFrame = script.Parent.Move.CFrame - Vector3.new(1.1,0,0)
wait(.05)
end
of.Value = false
end
db = false
end
end)
script.Parent.Close.ClickDetector.MouseClick:connect(function()
if db == false then
if of.Value == false then
db = true
for i = 0, 60, 1 do
script.Parent.Move.CFrame = script.Parent.Move.CFrame - Vector3.new(-1.1,0,0)
wait(.05)
end
of.Value = true
end
db = false
end
end)
Please reply.
