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 » Scripting Helpers
Home Search
 

Re: Anyone have a Regen Button with a script that...

Previous Thread :: Next Thread 
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 06:51 PM
Clones the vehicle but wouldn't remove it from the person driving it?



-You just got Liquified-
Report Abuse
domorox17 is not online. domorox17
Joined: 06 Mar 2012
Total Posts: 1710
24 Nov 2013 06:52 PM
just make it clone a new one from lighting or serveerstorage but not delete it
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
24 Nov 2013 06:52 PM
I have an idea, Create it yourself if you have errors were here to help
Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 06:53 PM
This is why I don't come to this forum often



-You just got Liquified-
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
24 Nov 2013 06:55 PM
Because you don't understand this forum that's why maybe you should read the rules of the forum
Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 06:57 PM
You have 266 posts



-You just got Liquified-
Report Abuse
Andrew1234567mmm is not online. Andrew1234567mmm
Joined: 14 Oct 2009
Total Posts: 691
24 Nov 2013 06:58 PM
What does that have to do with anything?

You joined roblox in 6/17/2013

So what?
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:04 PM
Cloning something from lighting sounds very easy to me!...


function onTouch() --does the connection line have to be in the ()?

car = game.Lighting.CAR:clone()
car.Position = (0,0,0) --Position
end

car.Touched:connect(onTouch)

Change "CAR" with your car's name.
Make sure the car is in lighting.

change the position to the position you want it to spawn at.

May be missing a few things. But, I am not sure about the connection line with the function.
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:05 PM
Oh that was a fail... I said car:touched :(

I make you a new one.
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:13 PM
local button = game.Workspace.Button

function onTouch()
wait(2)
car = game.Lighting.CAR:clone()
car.Position = (0,0,0)
end

button.Touched.connect(onTouch)


I am positive this will work.

Added in a wait, to prevent infinite cars spawning.
Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 07:14 PM
Thanks so much! I'll test.



-You just got Liquified-
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:14 PM
Sorry,

button.Touched:connect(onTouch)
Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 07:18 PM
wait how do I make this one not delete the vehicle?


--Person299
--Put the objects you want regenned in the model, if the object's parent is changed it will not be deleted when the button is pushed again.
debounce = false
regen = {}
last = {}
for a,b in ipairs(script.Parent.Parent:GetChildren()) do
if b ~= script.Parent then
table.insert(regen,b:clone())
table.insert(last,b)
end end
script.Parent.Touched:connect(function(hit)
if hit.Parent ~= nil then
if game.Players:playerFromCharacter(hit.Parent) ~= nil and debounce == false then
debounce = true
for a,b in ipairs(last) do
if b.Parent == script.Parent.Parent then
b:remove()
end end
last = {}
for a,b in ipairs(regen) do
local c = b:clone()
table.insert(last,c)
c.Parent = script.Parent.Parent
pcall(function() c:MakeJoints() end)
end
script.Parent.BrickColor = BrickColor.new(26)
wait(2)
script.Parent.BrickColor = BrickColor.new(104)
debounce = false
end end end)
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:18 PM
I messed up the last one, sorry.

If you don't know what to do with the last line, here is the final product.


local button = game.Workspace.Button

function onTouch()
wait(2)
car = game.Lighting.CAR:clone()
car.Position = (0,0,0)
end

button.Touched.connect(onTouch)

Tell me if this works, if it doesn't, give me the output.
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:20 PM
Oh look, another free model. :P

I tried hard to make you this, use the final product before advancing, or get out.
Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 07:22 PM
I would use it if I didn't have to put the items in lighting and all that



-You just got Liquified-
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:23 PM
Mine has a 99% chance of success.

Follow these instructions:

Just put a brick into lighting (to determine if the whole script works)

name it CARNAME.

Put in the location of the brick into the script.

Make a button into workspace named Button.

Press the button and see if it works!


Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 07:24 PM
I know it works, but I have so many cars that I need a script for, this would take too long



-You just got Liquified-
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:26 PM
Your lost.

No one is going to help you edit a complicated freemodel.

I took time to assist you.

You should use mine, it is actually not time consuming...

Just drag cars into lighting and change the button properties....

Unbelievable, what your saying.
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
24 Nov 2013 07:28 PM
You would have to clone the entire thing and remodel the seat into the newly cloned model from the lighting
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:30 PM
YOU help him then.
Report Abuse
Gamemaking is not online. Gamemaking
Joined: 17 Jun 2013
Total Posts: 7686
24 Nov 2013 07:33 PM

Thanks @G


-You just got Liquified-
Report Abuse
kingbowler1040 is not online. kingbowler1040
Joined: 03 Oct 2011
Total Posts: 1202
24 Nov 2013 07:33 PM
Sorry,

local button = game.Workspace.Button

function onTouch()
wait(2)
car = game.Lighting.CAR:clone()
car.Position = Vector3.new(0,0,0)
end

button.Touched.connect(onTouch)

Forgot that positioning needs a vector3.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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