I have no idea how to do this, i put a script in the drooling zombie model and all the parts like the arms and all but it still doesn't work
I tried to make it so that it jumpscares via replicated storage and debounce is a 5 second timer, I'm just not sure why its not working
` local JumpscareEvent = game.ReplicatedStorage.JScareEvent local Debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Head:FindFirstChild("Humanoid") then if Debounce == false then Debounce = true local Player = game.Players:GetPlayerFromCharacter(hit.Parent) JumpscareEvent:FireClient(Player) wait(5) Debounce = false end end
end)`
You're looking for the Humanoid in the character's head, when you should be looking for it in the character itself.
local JumpscareEvent = game.ReplicatedStorage.JScareEvent local Debounce = false script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if Debounce == false then Debounce = true local Player = game.Players:GetPlayerFromCharacter(hit.Parent) JumpscareEvent:FireClient(Player) wait(5) Debounce = false end end end)
Place the script inside a basepart of the zombie, or change script.Parent to script.parent:FindFirstChild().
TBH i would recommend making an invisible Hitbox and weld it to the humanoidrootpart of the zombie
Touched is an event of 'BaseParts', not models.
Also, the Humanoid exists as a child of the model itself, not the head.
local jumpscareevent = game.ReplicatedStorage.JScareEvent -- path to event here local hitbox = script.Parent:FindFirstChild("Hitbox") --put your path to hitbox here local cd = --your cd local debounce = false hitbox.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and debounce == false then debounce = true local plr = game.Players:GetPlayerFromCharacter(hit.Parent) jumpscareevent:FireClient(plr) task.wait(cd) debounce = false end)