Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

Log in to vote
0
Answered by
Punctist 120
3 years ago
Edited 3 years ago

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)

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. Punctist 120 — 3y
0
Yeah it does work but it launches me way too far away OreyTheOre 52 — 3y
0
Also please add me in discord so it would be easier to fix: Orey#3816 OreyTheOre 52 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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!

0
It doesn't work OreyTheOre 52 — 3y
0
Any errors in output? CrunchChaotic 139 — 3y
0
well does it have to be a local script?? you did not tell me OreyTheOre 52 — 3y
0
A regular server sided script just a Script not a LocalScript CrunchChaotic 139 — 3y
View all comments (3 more)
0
Workspace.Auto Mine.Trigger.Script:3: attempt to call a nil value - Server - Script:3 is the error OreyTheOre 52 — 3y
0
Change the ‘N’ in Instance.New to a lowercase ‘n’ CrunchChaotic 139 — 3y
0
it now works, but it launches me very far, how can i fix it? OreyTheOre 52 — 3y

Answer this question