Hi! So currently I am messing around with kill bricks, and I’ve tried a couple different ways to kill the player. But the ones I’ve tried, you can jump on, and if you keep jumping, you don’t die?
I have tried multiple scripts now, but on the ones I’ve tried, you are able to jump on them without dying. If you hold down the jump bar it doesn’t activate the kill script. What should I do?
Here is my script. (I have it set up so the parts in a certain folder all are kill parts)
local folder = workspace.KillBricks
for _,v in pairs(folder:GetChildren()) do
if v:IsA('BasePart') then
v.Touched:Connect(function(touched)
local possibleHumanoid = touched.Parent:FindFirstChildWhichIsA('Humanoid')
if possibleHumanoid then
possibleHumanoid.Health = 0
end
end)
end
end
This is an issue with roblox itself and how r15 works, you should wrap the kill brick with an uncollideable part and put the script in that one instead
If you don’t want the hitbox to be bigger you can make the actual brick smaller and the uncollidable part as big as the brick, but if you can you should make the whole brick uncollidable
local Players = game:GetService('Players')
local LocalPlayer = Players.LocalPlayer
local folder = workspace:WaitForChild('KillBricks')
for _,v in pairs(folder:GetChildren()) do
if v:IsA('BasePart') then
v.Touched:Connect(function(touched)
local character = touched.Parent
local player = Players:GetPlayerFromCharacter(character)
if player and player == LocalPlayer then
local possibleHumanoid = character:FindFirstChildWhichIsA('Humanoid')
if possibleHumanoid then
possibleHumanoid.Health = 0
end
end
end)
end
end