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 » Scripters
Home Search
 

Re: vector3 help

Previous Thread :: Next Thread 
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
19 Aug 2017 09:10 PM
I want to make a door, that opens and closes.
So I need the door to decrease in size but stay against the wall it's joined. (I don't want it to take off 1 from each side)

to explain better, can someone give me a script that will make the x cord -1 every second, and check to see if the x size is = 5. once it reaches 5 it stops.

this maybe confusing it makes sense in my mind...


Report Abuse
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
19 Aug 2017 09:20 PM
b


Report Abuse
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
19 Aug 2017 10:03 PM
U
Report Abuse
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
20 Aug 2017 09:44 AM
m


Report Abuse
nothingguy123 is not online. nothingguy123
Joined: 25 Sep 2013
Total Posts: 68
20 Aug 2017 10:51 AM
Local d = --door

Repeat
d.CFrame.x -= 1
Until d.CFrame.x == 5
Report Abuse
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
20 Aug 2017 11:25 AM
It's not working, I think It has something to do with my click function.

Using a click detector and onClick() Function.


Report Abuse
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
20 Aug 2017 11:30 AM
http://wiki.roblox.com/index.php?title=API:Class/TweenService

https://www.youtube.com/watch?v=oV8HGhZudgk


Report Abuse
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
20 Aug 2017 12:01 PM
that doesn't help



Report Abuse
chickenmax1 is not online. chickenmax1
Joined: 28 Jun 2015
Total Posts: 242
21 Aug 2017 09:50 PM
bump again, all I need is it to resize to left...


Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
21 Aug 2017 10:17 PM
Try to solve it yourself and post the specific part where you are stuck.

Post your code along with any errors in the Output after you have attempted.


Even if the code isn't actual Lua, but something like

if this happens then do this
this happens
end

so it makes it worthwhile helping you because we know that way that you'll probably be able to get results.

don't post millions of lines of code either. keep it simple
Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
21 Aug 2017 10:30 PM
This should do anywho but in future, post your own code for quicker results:

d = Workspace.Door --Change this to the directory of your door.
debounce = false
doorOpening = false

function click()

if debounce == false then
debounce = true

if doorOpening == false then

for i = 1, 5 do --Do this 5 times
wait(0.1) --For aesthetics
d.Size = d.Size - Vector3.new(2, 0, 0) --Minus one from both sides of door by minusing 2
d.CFrame = d.CFrame - Vector3.new(1, 0, 0) --Minus one in x direction to keep it in place
end

doorOpening = true

else

for i = 1, 5 do --Do this 5 times
wait(0.1) --For aesthetics
d.Size = d.Size + Vector3.new(2, 0, 0) --Add one from both sides of door by adding 2
d.CFrame = d.CFrame + Vector3.new(1, 0, 0) --Add one in x direction to keep it in place
end

doorOpening = false

end

debounce = false

end
end

blahblah.ClickDetector:connect(click)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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