Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make a part explode when touched? Also doesn't kill you

Hey there. so i'm trying to make a Fall Guys remake (nobody cares i know) but i want to make a mine that doesn't kill you. Is it possible?

If it is. Tell me the code, where to put it and if it is a local script or not.

2 answers

✓ Accepted answer

Try this one.

local debounce = false

script.Parent.Touched:Connect(function(hit)
    if debounce == false then
        debounce = true
         if hit.Parent:FindFirstChild("RightFoot") or   hit.Parent:FindFirstChild("RightLeg")  then
            local boom = Instance.new("Explosion")
            boom.DestroyJointRadiusPercent = 0
            boom.BlastPressure = 73500 --Change the 73500 to whatever
            boom.Position = script.Parent.Position
            boom.Parent = workspace
        end
        wait(3)
        debounce = false
    end
end)

3 comments

0

you can change the (if hit.Parent:FindFirstChild("RightFoot") or hit.Parent:FindFirstChild("RightLeg") then) to (if hit.Parent:FindFirstChild("Humanoid") then) if you'd like to.

0

Yeah it does work but it launches me way too far away

0

Also please add me in discord so it would be easier to fix: Orey#3816

This should be a regular server sided script in the part.

script.Parent.Touched:Connect(function(Part)
    if Part.Parent:FindFirstChild("Humanoid") then
        local explosion = Instance.New("Explosion")
        exposion.Position = script.Parent.Position
        explosion.DestroyJointRadiusPercent = 0
        explosion.Parent = workspace
    end
end)

Hope this helps!

7 comments

0

It doesn't work

0

Any errors in output?

0

well does it have to be a local script?? you did not tell me

0

A regular server sided script just a Script not a LocalScript

0

Workspace.Auto Mine.Trigger.Script:3: attempt to call a nil value - Server - Script:3 is the error

0

Change the ‘N’ in Instance.New to a lowercase ‘n’

0

it now works, but it launches me very far, how can i fix it?

This discussion is preserved as it was. New answers, comments, and votes are closed.