|
| 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 |
|
|
| |
|
| |
|
| |
|
|
| 20 Aug 2017 10:51 AM |
Local d = --door
Repeat d.CFrame.x -= 1 Until d.CFrame.x == 5
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 21 Aug 2017 09:50 PM |
bump again, all I need is it to resize to left...
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|