|
| 05 Sep 2011 08:39 PM |
Ok, so this is a gate script. two walls moving away from eachother when open, and coming together when closed. I need to make the walls go 10 studs more away from eachother, in addition to the amount already given.
So, I found this scriot on FMs, as I can't script for anything. What line effects the distance, and what number to I change to make it do what I want?
Script:
door = script.Parent door1 = door.Door1 door2 = door.Door2 button = door.Button isopen = door.IsOpen debounce = door.Debounce
button.ClickDetector.MouseClick:connect(function() if (debounce.Value == false) then if (isopen.Value == true) then isopen.Value = false elseif (isopen.Value == false) then isopen.Value = true end button.BrickColor = BrickColor.new("Really black") end end)
isopen.Changed:connect(function() if (debounce.Value == false) then debounce.Value = true if (isopen.Value == true) then for i=1, 190 do door1.CFrame = door1.CFrame * CFrame.new(-0.1,0,0) door2.CFrame = door2.CFrame * CFrame.new(0.1,0,0) wait() end debounce.Value = false button.BrickColor = BrickColor.new("Really red") return end if (isopen.Value == false) then for i=1, 190 do door1.CFrame = door1.CFrame * CFrame.new(0.1,0,0) door2.CFrame = door2.CFrame * CFrame.new(-0.1,0,0) wait() end debounce.Value = false button.BrickColor = BrickColor.new("Cyan") return end end end)
DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ] |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:41 PM |
| The second number in the for i loop |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:41 PM |
I know it's one of these lines, but which of the 0,0,0 effects it? As I'm afraid if I make the -0.1 a -0.2, it will double.
door1.CFrame = door1.CFrame * CFrame.new(-0.1,0,0) door2.CFrame = door2.CFrame * CFrame.new(0.1,0,0)
DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ] |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:42 PM |
This?
door2.CFrame = door2.CFrame * CFrame.new(0.1,0,0)
DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ] |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:44 PM |
for i=1, 190 do ^second number (190)
To get the distance you want it to go, set 190 to the distance you want times 10 |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:44 PM |
Thanks for the help..
DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ] |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:45 PM |
So if you want it to go 30 studs, for i = 1, 300 do
Also, you need to change this twice in the script, because there are 2 for i loops |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 08:47 PM |
I saw, thanks again!
DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ] |
|
|
| Report Abuse |
|
|