|
| 13 Feb 2015 07:42 AM |
I want to make it so my respawn pad doesn't make another copy of the vehicle without removing the old one. Those anyone have a script I can add that makes it so vehicles get deleted when I press a button? Please help
The script I use:
--Edited by Jesus--
model = script.Parent.Parent messageText = "Regenerating the Object"
message = Instance.new("Hint")message.Text = messageText backup = model:clone() enabled = true
function regenerate() message.Parent = game.Workspace model:clone()
wait(2)--Change this number for the time in seconds it will take to regen your model.
model = backup:clone() model.Parent = game.Workspace model:makeJoints() message.Parent = nil
script.Disabled = true script.Parent.BrickColor = ("Black") -- Change "Black" for the exact name of the color you want, the name can be found at any brick's Properties, just click the BrickColor tab and select the one you want. wait(5)--Change this number for the time in seconds it will take between regenerations. script.Parent.BrickColor = ("Bright violet") -- Change "Bright violet" for the exact name of the color you want, the name can be found at any brick's Properties, just click the BrickColor tab and select the one you want. script.Disabled = false end
script.Parent.ClickDetector.MouseClick:connect(regenerate) |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Feb 2015 09:53 AM |
| If you help I'll add you in my game description. |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 13 Feb 2015 10:00 AM |
model = script.Parent.Parent
local backup = game.Lighting.Car:clone() --PUT THE MODEL IN LIGHTING NAMED "Car" local db = false
script.Parent.ClickDetector.MouseClick:connect(function()
if not db then db = true end
local h = Instance.new("Hint").Text = "Regenerating the object.." wait(1) h:Destroy()
local new = backup:Clone().Parent = workspace new:makeJoints() new.CFrame = CFrame.new(1,1,1)
script.Parent.BrickColor = BrickColor.new("Lime gren")
wait(2)
script.Parent.BrickColor = BrickColor.new("Really Red")
db = false
end)
|
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 13 Feb 2015 10:01 AM |
--OOPS, DIDNT READ model = script.Parent.Parent
local backup = game.Lighting.Car:clone() --PUT THE MODEL IN LIGHTING NAMED "Car" local db = false
script.Parent.ClickDetector.MouseClick:connect(function()
if not db then db = true end
local h = Instance.new("Hint").Text = "Regenerating the object.." wait(1) h:Destroy()
workspace:FindFirstChild("OldCarName"):Destroy() local new = backup:Clone().Parent = workspace
new:makeJoints() new.CFrame = CFrame.new(1,1,1)
script.Parent.BrickColor = BrickColor.new("Lime gren")
wait(2)
script.Parent.BrickColor = BrickColor.new("Really Red")
db = false
end)
|
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 12:21 PM |
| http://www.roblox.com/Orange-County-Alpha-0-7-Snapshot-0-2-place?id=157998236 added u in my game description :) |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 12:43 PM |
| nvm the script didnt work because if I placed the car into light it wouldn't be in the terrain |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 12:47 PM |
| i meant to say it doesnt work, i put a copy in lighting and it didnt work |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 12:58 PM |
| maybe it isnt connected to a click detector or something |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 13 Feb 2015 01:20 PM |
--I see errors, try this -- name the car "car" model = script.Parent.Parent
local backup = game.Lighting.Car:clone() --PUT THE MODEL IN LIGHTING NAMED "Car" local db = false
script.Parent.ClickDetector.MouseClick:connect(function()
if not db then db = true end
local h = Instance.new("Hint").Text = "Regenerating the object.." wait(1) h:Destroy()
workspace:FindFirstChild("Car"):Destroy() local new = backup:Clone().Parent = workspace
new:MakeJoints() new:MoveTo(1,1,1)
script.Parent.BrickColor = BrickColor.new("Lime green")
wait(2)
script.Parent.BrickColor = BrickColor.new("Really Red")
db = false
end) |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 01:53 PM |
| local h = Instance.new("Hint").Text = "Regenerating the object.." That line had a red line under the =? Btw the script still didn't work ;~; |
|
|
| Report Abuse |
|
|
Stormify
|
  |
| Joined: 27 Jan 2012 |
| Total Posts: 378 |
|
|
| 13 Feb 2015 02:23 PM |
local h = Instance.new("Hint") h.Text = "Regenerating the object.."
kthxbye |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2015 02:46 PM |
| Nope, *sigh* still didn't work :( |
|
|
| Report Abuse |
|
|