I’m attempting to make a part roll as it is following my character and it will kill them when the player touches it.
The issue is that the part does roll but it stops when it teleports to the player to follow them.
I tried swapping the tasks around but that didn’t work
Code:
script.Parent.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end)
task.spawn(function()
while true do
local turningSpeed = 10
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0, math.rad(turningSpeed), 0)
wait(0.01)
end
end)
task.wait(2)
local player = game.Players.ExtremeSteaks
local char = player.Character
while true do
workspace.Part.CFrame = char.UpperTorso.CFrame:ToWorldSpace(CFrame.new(0,0,5))
task.wait(0.01)
end
script.Parent.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end)
task.wait(2)
local player = game.Players.ExtremeSteaks
local char = player.Character
while true do
workspace.Part.CFrame = char.UpperTorso.CFrame:ToWorldSpace(CFrame.new(0,0,5))
local turningSpeed = 10
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0, math.rad(turningSpeed), 0)
task.wait(0.01)
end
Ball follow - only target once.rbxm (4.3 KB)
Totally it was from Ball then you add it SpecialMesh as Cube. I also modify physic using “BodyAngularVelocity” avoid getting roll too far
Script
local Speed=1.2 -- set 2 It's already powerful
script.Parent.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end)
task.wait(2)
--local player = game.Players.ExtremeSteaks
local player = game.Players.Hezt0z
local char = player.Character
while true do
workspace.Part.Velocity=workspace.Part.Velocity-(workspace.Part.Position-char.HumanoidRootPart.Position).unit*Speed
task.wait(0.01)
end