I wanted to make a clone of the flag when the player dies with it, but nothing is printing. Except for line 7, but not line 11. Please help me if you can. Thanks.
script.Parent.RedFlag.Handle.Touched:Connect(function(char)
if char ~= nil then
local player = game.Players:GetPlayerFromCharacter(char.Parent)
if player ~= nil then
if char.Parent:FindFirstChild("Humanoid") then
if char.Parent:FindFirstChild("Humanoid").Health ~= 0 then
print(player.Name .. " has the Red Flag!")
if char.Parent:FindFirstChild("Humanoid").Health == 0 and char.Parent:FindFirstChild("RedFlag")then
local FlagClone = game.ServerStorage:FindFirstChild("RedFlag"):Clone()
FlagClone.Parent = game.Workspace
print(FlagClone.Parent)
end
end
end
end
end
wait(1)
end)

4 comments
Ok thanks
But, do you know why my clone isn't showing up in Workspace? It's not even printing the name. If you can't help, its totally fine.
Ill just make it another question for other people to answer if you can't.
Try my edit.