TheStels
|
  |
| Joined: 11 Dec 2014 |
| Total Posts: 10 |
|
|
| 25 Mar 2016 09:18 AM |
i'm making my own Tycoon, but i have a problem I really want to make Sliding gate, but i'm not a experienced scripter Can you guys please help me? This script is works by radius. (If a pl near the gate it would opens) i want to transfer this gate moving to buttons moving (Green and Red button)
SCRIPT: local Open = false local Radius = 13
function MoveDoors(mod) for i = 1, 10 do script.Parent.DoorA.Mesh.Scale = script.Parent.DoorA.Mesh.Scale + Vector3.new(-.1 * mod, 0, 0) script.Parent.DoorB.Mesh.Scale = script.Parent.DoorB.Mesh.Scale + Vector3.new(-.1 * mod, 0, 0) script.Parent.DoorA.Mesh.Offset = script.Parent.DoorA.Mesh.Offset + Vector3.new(.2 * mod, 0, 0) script.Parent.DoorB.Mesh.Offset = script.Parent.DoorB.Mesh.Offset + Vector3.new(-.2 * mod, 0, 0) wait() end script.Parent.DoorA.CanCollide = mod == -1 script.Parent.DoorB.CanCollide = mod == -1 end
while wait(.5) do local openning = false for _, v in pairs(game.Players:GetPlayers()) do if v:DistanceFromCharacter(script.Parent:GetModelCFrame().p) < Radius then openning = true end end if openning and not Open then MoveDoors(1) Open = true elseif not openning and Open then Open = false MoveDoors(-1) end end |
|
|
| Report Abuse |
|