Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local clone = script.Parent.CloneBool
- local distance = 0
- -- Function to move our killblock
- function move()
- if clone.Value == true then
- script.Parent.CFrame = script.Parent.CFrame+Vector3.new(0,0,1)
- wait (0.000001)
- -- Once 1000 distance is covered, destroy the object
- distance = distance + 1
- --Add in an if statement that destroys the object after a set of value is traveled
- if distance >= 1000 then
- script.Parent:Destroy()
- end
- end
- end
- game:GetService('RunService').Heartbeat:Connect(move)
- -- Function to kill the player on touch
- function kill(part)
- local humanoid = part.Parent:FindFirstChild('Humanoid')
- -- If it is a humanoid, reduce health to 0
- if humanoid then
- humanoid:TakeDamage(humanoid.Health)
- end
- end
- script.Parent.Touched:Connect(kill)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement