Okay, I made this script so when the player's health is 0, then it clones the script called deathscript to the character. Sadly the results didn't come according to plan. I tried rewriting it many times. I'm a beginner scriptwriter, and I would appreciate if you help me and tell me the problem.
local player = game.Players.LocalPlayer.Character
local humanoid = player.Humanoid
while wait() do
local dead = script.deathscript:Clone()
if humanoid.Health <= 0 then
dead.Parent = player
end
end

2 comments
There's no reason to leave the "while" loop here. It's best if you remove it.
Oh that's true. I completely overlooked it.