When I clone an npc from ReplicatedStorage through a remote event, the .Touched event does not work. Everything is spelled correctly and the damage script seems to work fine when I don’t clone it and it doesn’t work in Roblox Player. The following script works and the script is inside the cloned npc when I check it.
Damage Script:
local plr = game.Players.PlayerAdded:Wait()
local db = false
script.Parent:WaitForChild("Humanoid").Touched:Connect(function(hit)
if hit.Parent:FindFirstChildWhichIsA("Humanoid") and hit.Parent.Name == plr.Character.Name then
if db == false then
db = true
hit.Parent.Humanoid:TakeDamage(50)
wait(1)
db = false
end
end
end)
and when I put put print(“fheiohgoi”) before the humanoid part nothing pops up and there are no errors in output. pls help me