|
| 04 Jul 2016 09:41 PM |
A click door I need to make accessible to only people that are in a certain group.
w = script.Parent.Parent.Parent.Doors.Door1 d = script.Parent.Parent.Parent.Doors.Door2 f = script.Parent.Parent.Parent.Doors.Door3
function onClicked (mouse)
if script.Parent.Moving.Value == 1 then script.Parent.Moving.Value = 2
for r = 1,50 do wait() for r,p in pairs(w:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(-.1,-.1,0) end end for r,p in pairs(d:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(.1,-.1,0) end end for r,p in pairs(f:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,.2,0) end end
end
wait(5)
for r = 1,50 do wait() for r,p in pairs(w:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(.1,.1,0) end end for r,p in pairs(d:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(-.1,.1,0) end end for r,p in pairs(f:GetChildren()) do if (p.className == "Part" or "Wedge" or "Truss" or "Seat") then p.CFrame = p.CFrame - Vector3.new(0,-.2,0) end end
end script.Parent.Moving.Value = 1
else
if script.Parent.Moving.Value == 2 then print("Patience is a virtue")
end end
end script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
| |
| |
| |
| |
|
| 04 Jul 2016 10:59 PM |
The only fool-proof way to do this would be with FE and client-sided part properties.
"Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin |
|
|
| Report Abuse |
|