|
| 21 Jan 2017 09:50 AM |
| How do I make a plane regen? With a button. Please help me with this, thanks! |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 09:58 AM |
depends what kind of button it is. gui or brick. |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jan 2017 10:01 AM |
clicking brick or touched brick.
|
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:03 AM |
| Touched, when you walk over it. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:11 AM |
use the touchedEvent.
put the script under the brick, doing so, allows you to call the parent of the script, a brick.
so, brick = script.Parent
then you will want to use the roblox part api, and inside that api there is a function called TouchedEvent.
|
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:11 AM |
local plane = game.Workspace.plane --change this to ur plane name local enabled = true
function onTouched(hit) if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then local copy = plane:clone() plane:remove() script.Disabled = true wait(4) --regen time copy.Parent = workspace copy.Position = Vector3.new(-179.17, 0.5, -112.89) --position it regens at script.Disabled = false end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:18 AM |
i do not think he understands position, but whatever. providing code does not help anyone :P |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:19 AM |
also, if you disable a script, ya cannot renable it at least inside the script.
|
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:21 AM |
| Scott, don't you think it's a little far fetched to say he doesn't understand position? |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:22 AM |
| So it ###### the tools in it, and the plane, in the exact position? |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jan 2017 10:46 AM |
put the code in a local script inside a textbutton
local plane = game.Workspace.plane local p = game.Players.LocalPlayer button = script.Parent
button.MouseButton1Click:connect(function()
local copy = plane:clone() plane:remove() script.Disabled = true wait(4) --regen time copy.Parent = workspace copy.Position = Vector3.new(-179.17, 0.5, -112.89) --position it regens at script.Disabled = false end) |
|
|
| Report Abuse |
|
|