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

Rolling, moving up and down and kill on touch cylinder. Could that work?

Asked by 6 years ago

I tried making a cylinder that does those things but the killing on touch part doesn't work...

Problem is...Whenever I include the touch kill part of the script: (I'll include the not working part of the script)

local part = script.Parent.Center


part.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    hit.Parent:BreakJoints()
    print("dead")
end
end)

So it worked but then the tween stood up stuck. I tried to make it in separate scripts but that didn't seem to make any difference. The scripts and the cylinder are all in a model. I don't know what to do...

1 answer

Log in to vote
0
Answered by
Ap_inity 112
6 years ago

Instead of using the BreakJoints() function, you can use the Humanoid's health value at your advantage! I've fixed your script to include this new function.

local part = script.Parent.Center


part.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.Health = 0 -- Instead of breaking the user's joints, we're setting it's health to 0 and instantly killing the user!
        print("dead")
    end
end)

0
Thanks dude! NetBurst 7 — 6y
Ad

Answer this question