I have attempted to make a script (multiple times now) that explodes a car when a part of it touches something. I have searched Youtube and followed tutorials but nothing seemed to work.
What part is that? I mean the one that when get touched it should create the explosion? Its the main base of the car?
Cause your script should cause an explosion even when its touched by the player. Meaning that if you get on it and it doesnt explode the Touched event is not even firing it.
Is the part able to be touched? add prints to verify that the touch event at least fires
I already watched the video, you jump into the car and it doesnt explode… And your script should cause that the explosion happens even when the player touch it, and actually lot of times cause you are not using debouces, and the part where you are parenting the explosion you are destroying it right away.
Before fixing all those issues… You gotta make sure that the Touched event is even firing. I already read your entire post and watch the video. I suggest first add prints and be sure that the Touched event fires, cause according to the video and using that script the event should fire multiple times. Perhaps the part has no touch enabled, maybe the part is unreachable for the touch event.
First try debugging before thinking others didnt read your post…
local Part = script.Parent
local Car = Part.Parent
task.wait(3)
Part.Touched:Connect(function(hit)
Part.Anchored = true
Part.CanCollide = false
Part.Transparency = 0
local Explosion = Instance.new("Explosion")
Explosion.Position = Part.Position
Explosion.BlastRadius = 10
Explosion.BlastPressure = 1000000
Explosion.Parent = Part
Part:Destroy()
end)
It might be because the explosion is happening instantly as soon as the server starts because it’ll already be touching something, so maybe delaying it might work.
Hey thanx! I saw your edit in your reply now. So its the red part. Ok, then it should not explode when you character jumps in. Still, add prints otherwise you dont know if the touch event fires. If you dont see the print the problem is the Touch event