generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Location.

Previous Thread :: Next Thread 
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
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
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
05 Sep 2011 08:41 PM
The second number in the for i loop
Report Abuse
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
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
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
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
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
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
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
05 Sep 2011 08:44 PM
Thanks for the help..

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
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
DigitalSkill is not online. DigitalSkill
Joined: 18 May 2011
Total Posts: 906
05 Sep 2011 08:47 PM
I saw, thanks again!

DigitalSkill; Nothing more, nothing less. [ I am the original Abdulimrandsa1 ]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image