I'm new to scripting and I'm currently making an obby. I've been trying to modify my kill brick script to where you won't die from it if you have a certain gamepass, but I can't figure it out.
Here's the script for the kill brick.
function onTouched(Obj)
local h = Obj.Parent:FindFirstChild("Humanoid")
if h then
h.Health = 0
end
end
script.Parent.Touched:Connect(onTouched)

2 comments
also the script in the kill part doesnt matter
It works, but only on one kill brick. I need the script to work on all kill bricks.