I need ideas that can make a kill block that kills you while you are in a moving object in roblox studio. When I am in a moving veical, the my part that kill be does not work.
I'm sorry if this is not about coding.
I need ideas that can make a kill block that kills you while you are in a moving object in roblox studio. When I am in a moving veical, the my part that kill be does not work.
I'm sorry if this is not about coding.
Very easy.
local Humanoid = Instance.new("Humanoid")
while wait() do
if Humanoid.MoveDirection.Magnitude > 0 then
Humanoid.Health = 0
end
end
When they move they get killed.
OR
local Humanoid = Instance.new("Humanoid")
local HumanoidRootPart = Instance.new("Part")
HumanoidRootPart.Touched:Connect()
if Part.Anchored == false then
Humanoid.Health = 0
end
end
make a part first in the workspace if you want to create it using script, then use this code
local part = Instance.new("Part")
part.Parent = game.Workspace
part.Position = --Desired position
--e.g you could do "part.Position = game.Workspace.Car.Seat.Position"
Then you need to create a script that when it is touched it sets the player's health to zero. So to do this you need to do
part.Touched:Connect(function(plr)
if plr.Parent:FindFirstChild("Humanoid") then --This is looking for a HumanoidRootPart to see if it is a roblox character
plr.Parent:FindFirstChild("Humanoid").Health = 0 --This is setting the health of the HumanoidRootPart (the main part of the character) to zero
end
end)
Hope this helped
kingblaze_1000 don't just ask for the Humanoid use plr.Parent:FindFirstChildOfClass("Humanoid")
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
This is not a request site. Please provide some attempt of this.
I'm sorry but i really need help.