|
| 01 May 2017 07:10 PM |
I am working a tycoon, and im putting in tanks, and vehicles. One problem I have is that after you blow up the vehicles, the wreckage stays there until someone re-spawns it. It can cause lag after a few vehicles are destroyed.
Does anyone know how to make the blocks dis-appear after 15 seconds from being "Un-welded" or being disconnected from their model?
Id prefer it if the blocks slowly went translucent before dis-appearing, but either way is fine :P |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 01 May 2017 07:13 PM |
game:GetService("Debris"):AddItem(Part,1) Something like that. |
|
|
| Report Abuse |
|
|
|
| 01 May 2017 07:15 PM |
Could you explain on approximately what I have to do?
And is there a way I can detect to see if the Vehicle has exploded or not?
-Thanks! |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 01 May 2017 07:21 PM |
| You have to find out when a part falls of or what ever you're trying to make trigger it, get that part then just AddItem |
|
|
| Report Abuse |
|
|
|
| 01 May 2017 07:30 PM |
This is what I am trying to do:
If a piece of a vehicle falls off, remove that specific block after 15 seconds.
If I do it the way that you recommended, do I have to put the script in every single piece of the vehicle??? Or is there a way to do it through the model?
Another thing that I can do is to respawn the vehicle after a specific block inside the vehicle that I choose gets ripped from its weld, I dont know how to check if the block is not part of its weld or model :P |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2017 01:58 PM |
You should probably learn to script before doing this.
wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 05 May 2017 01:59 PM |
local model = here
for i,v in ipairs(model:GetChildren()) do game:GetService("Debris"):AddItem(v, 15)
end
Join my group: https://www.roblox.com/My/Groups.aspx?gid=3217670 |
|
|
| Report Abuse |
|
|
hasang1
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 903 |
|
|
| 05 May 2017 02:07 PM |
@Dil Just add za whole model lol |
|
|
| Report Abuse |
|
|
Calviski
|
  |
| Joined: 03 Dec 2016 |
| Total Posts: 209 |
|
|
| 05 May 2017 02:09 PM |
if game.Workspace.Part.Visible = true then game.Workspace.Part:Destroy() |
|
|
| Report Abuse |
|
|
|
| 05 May 2017 03:40 PM |
^Was that even an attempt to give him a code?
Join my group: https://www.roblox.com/My/Groups.aspx?gid=3217670 |
|
|
| Report Abuse |
|
|
Calviski
|
  |
| Joined: 03 Dec 2016 |
| Total Posts: 209 |
|
| |
|
|
| 05 May 2017 06:06 PM |
I know how to code :/
I just dont know too much on Roblox specifics, but do I need to put a heartbeat loop for your code @Diligent_Coder? |
|
|
| Report Abuse |
|
|
|
| 05 May 2017 06:20 PM |
I tried the script out, and it didnt do anything. Did I do something wrong?
I placed it as a normal script and I went to my model for the variable. |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 May 2017 06:23 PM |
| Instead of "face palming" would you mind trying to help out? Or just dont reply at all. |
|
|
| Report Abuse |
|
|
|
| 05 May 2017 06:36 PM |
Oh nevermind, so it deletes the model no matter what, im going to try to give the vehicle "Health" so it will delete it after it has no "Health"
If you know a better way to do this, let me know. |
|
|
| Report Abuse |
|
|