I'm using a damage script when a object spawns depending on the mouse's location on top of a player and when it touches the enemy player it won't give me any errors nor does it gives the enemy player any damage. What i do know is that the function won't also work, when it connects with a player it won't print out any message. The damage script is also in a local script
Script:
local lightning = replicatedStorage.Lightning locla clone = Lightning.Clone() clone.Touched:Connect(function(h) print("oof") if h.Parent:FindFirstChild("Humanoid") and debounce then local enemyhumanoid = h.Parent.Humanoid enemyhumanoid:TakeDamage(15) wait(1) end end)
local lightning = replicatedStorage.Lightning local clone = Lightning.Clone() --^you said locla instead of local clone.Touched:Connect(function(h) print("oof") if h.Parent:FindFirstChild("Humanoid") and debounce then local enemyhumanoid = h.Parent.Humanoid enemyhumanoid:TakeDamage(15) wait(1) end end)