korky5000
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 228 |
|
|
| 05 Feb 2013 12:49 PM |
Makes a model regenerate when it's removed from the game? ex. Your driving a car, you go off the cliff. You die and so does the car. Then you respawn and "POOF" the car is there? Anyone? I can't seem to get this one working on my own :x |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 05 Feb 2013 12:51 PM |
You check if the model is nil, and if it is regen the model. This should work:
while true do repeat wait() until workspace["carModelName"] == nil game.Lighting["carModelName"]:Clone().Parent = workspace end
Obviously change the two "carModelName" strings to the name of your car. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Feb 2013 12:52 PM |
"Anyone know of a script that..." OH, MY, FLIPPIN, PAN!! Dem most annoying words ever! THIS IS NOT MARKET WITH PREMADE SCRIPTS! It's exactly like asking "Hey, do you guys know that english essay 'Water and all about it', can you give me it?" |
|
|
| Report Abuse |
|
|
korky5000
|
  |
| Joined: 20 Aug 2008 |
| Total Posts: 228 |
|
|
| 05 Feb 2013 12:54 PM |
| I usually ask for help with scripts, not ask for just a script. But I couldn't seem to figure this one out because it would regenerate the empty model, now I can get it from the lighting. And Zars, I understand that. But sometimes I just need some help. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Feb 2013 12:56 PM |
Then write it bit differently, because it sounds like you want us to get our library filled with all made scripts, and check for one that clones model, if it's gone.
"How would you make auto regenerating script" would make more sense.
Well you can try something like:
game.Workspace.ChildRemoved:connect(function(child) if child.Name == "Car" then local nCar = game.Lighting.Car:clone() end end) |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 05 Feb 2013 12:58 PM |
zars, that doesn't set the parent. :P
To set the parent, you'd need to do this: nCar.Parent = workspace or just change the clone line into one line: game.Lighting.Car:Clone().Parent = workspace |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 05 Feb 2013 12:59 PM |
| I just showed him how he could try to do it. I have no idea where he want's that new car, or anything. |
|
|
| Report Abuse |
|
|