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

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

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

✓ Accepted answer

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)

1 comment

0

Thanks dude!

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