Arkrane
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 2379 |
|
|
| 07 Jul 2016 05:50 PM |
Need help, trying to regen a boat, but whenever I test it, it never regens.
local Boat = Workspace.Boat3:Clone() local WaitTime = 10 local Debounce = true
script.Parent.ClickDetector.MouseClick:connect(function() if Debounce then Debounce = false script.Parent.BrickColor = BrickColor.new("Bright red") Boat.Parent = Workspace Boat = Boat:Clone() wait(WaitTime) Debounce = true script.Parent.BrickColor = BrickColor.new("Bright yellow") end end)
|
|
|
| Report Abuse |
|
|
Arkrane
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 2379 |
|
| |
|
Arkrane
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 2379 |
|
| |
|
D4rkly
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 1198 |
|
|
| 07 Jul 2016 06:50 PM |
Boat_Clone = Boat:Clone()
~D4rkly |
|
|
| Report Abuse |
|
|
D4rkly
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 1198 |
|
|
| 07 Jul 2016 06:50 PM |
Rather, Boat_Clone = Boat:Clone() Boat_Clone = Workspace
~D4rkly |
|
|
| Report Abuse |
|
|
D4rkly
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 1198 |
|
|
| 07 Jul 2016 06:52 PM |
Gah I need to read.
This should work.
local Boat = Workspace.Boat3:Clone() local WaitTime = 10 local Debounce = true
script.Parent.ClickDetector.MouseClick:connect(function() if Debounce then Debounce = false script.Parent.BrickColor = BrickColor.new("Bright red") Boat_Clone = Boat Boat_Clone.Parent = game.Workspace
wait(WaitTime) Debounce = true script.Parent.BrickColor = BrickColor.new("Bright yellow") end end)
~D4rkly |
|
|
| Report Abuse |
|
|
Arkrane
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 2379 |
|
|
| 07 Jul 2016 06:55 PM |
Just a question, would I put the boat in the regen model or does it just stay in workspace?
|
|
|
| Report Abuse |
|
|
D4rkly
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 1198 |
|
|
| 07 Jul 2016 06:55 PM |
OK. 100% works now.
local Boat = Workspace.Boat local WaitTime = 10 local Debounce = true
script.Parent.ClickDetector.MouseClick:connect(function() if Debounce then Debounce = false script.Parent.BrickColor = BrickColor.new("Bright red") Boat_Clone = Boat:Clone() Boat_Clone.Parent = game.Workspace
wait(WaitTime) Debounce = true script.Parent.BrickColor = BrickColor.new("Bright yellow") end end)
~D4rkly |
|
|
| Report Abuse |
|
|
D4rkly
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 1198 |
|
|
| 07 Jul 2016 06:58 PM |
Well, local Boat = Workspace.Boat
So it searches for the model to be cloned in Workspace.
If you change the parent of the boat, change where it should be searched for.
ex. local Boat = Workspace.Boats.Boat
~D4rkly |
|
|
| Report Abuse |
|
|
Arkrane
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 2379 |
|
|
| 07 Jul 2016 06:58 PM |
Thanks D4rkly, it works. But for some reason, it regens the wrong boat.
|
|
|
| Report Abuse |
|
|
Arkrane
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 2379 |
|
|
| 07 Jul 2016 06:58 PM |
Nevermind, just saw your last post. lol. Works great, thanks.
|
|
|
| Report Abuse |
|
|