player = game.Players.LocalPlayer
mouse = player:GetMouse()
shaUp = false
enabled = true
sha2 = false
sha1 = true
mouse.KeyDown:connect(function(key)
if player.Character.Humanoid.Health >0 then
if key == "x" and enabled == true and shaUp == false and sha1 == true then
key = key:lower()
enabled = false
shaUp = true
sha1 = false
local y = game.ReplicatedStorage.Me:clone()
y.Parent = game.Workspace
y.Name = player.Name
y.Torso.CFrame = player.Character.Torso.CFrame*CFrame.new(0,0,5)
sha1 = true
shaUp = true
print("Work")
mouse.Button1Down:connect(function(m)
y.Humanoid.WalkToPoint = mouse.hit.p
end)
wait()
enabled = true
if key == "c" then
player.Character.Humanoid.Health = 0
end
end
end
end)
You clone a shadow like figure from replicated storage. If you press c your supposed to die. Maybe I got confused with the true,false,etc?

5 comments
you should use UIS. not keydown
UIS?
User Input Service
I think I'll stick with KeyDown
Mouse.KeyDownis deprecated. This is a bad idea.