I need help, I'm trying to make a humanoid be able to get killed, but when the game starts it dies instantly
https://gyazo.com/9afb305114f0a6198b73dfe13fd2ba88 Here's a pic of the humanoid, inside of Workspace it is Tank. The script that is inside both parts is down below. They're both anchored.
local Part = script.Parent -- this is the Part we will move
local newPos = Part.Position + Vector3.new(-355,0,0) -- the position the Part will go to
local Time = 1 -- the time that the script will take to move the part
local Increment = 0.1 -- the Part will move 0.5 studs each time it moves
local Debounce = false
local Diff = newPos - Part.Position -- the difference between the two positions
local Mag = Diff.magnitude -- the distance between the two parts
local Direction = CFrame.new(Part.Position, newPos).lookVector
function MovePart() -- function to move the Part
if Debounce then return end -- end the function if debounce is true
Debounce = true -- make Debounce true so the function can't run
for n = 0, Mag, Increment do
Part.CFrame = Part.CFrame + (Direction * Increment)
wait( (Time/Mag) * Increment )
end
Debounce = false -- set Debounce to false so the function can run again
end
MovePart()
This is used to have it move
