So I have a cloned player, he is suppose to trail behind the players footsteps for 2 seconds and slowly get faster over time although, if I put in the loop,
velocityTime = velocityTime + 1
The clone stays still and absolutely nothing happens... Without it though, the clone is able to move...???
local plar = game.Players.LocalPlayer.Character:Clone()
wait(2)
local lastPositions = {}
local velocityTime = 200
spawn(function()
while true do wait(.01) -- negative 100 for one second
table.insert(lastPositions,tostring(game.Players.LocalPlayer.Character.HumanoidRootPart.Position))
end
end)
plar.Parent = workspace
plar.Name = plar.Name.."_Clone"
plar.Humanoid.WalkSpeed = 8
spawn(function()
while true do wait()
if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position-plar.HumanoidRootPart.Position).Magnitude < 10 then
plar.Humanoid:MoveTo(game.Players.LocalPlayer.Character.HumanoidRootPart.Position)
lastPositions = {}
else
if lastPositions[#lastPositions-velocityTime] then
local StringVector = lastPositions[#lastPositions-velocityTime]
local tab = {}
for s in string.gmatch(StringVector,"[^,]+") do
table.insert(tab,tonumber(s))
end
local NewVector = Vector3.new(unpack(tab))
plar:SetPrimaryPartCFrame(CFrame.new(NewVector))
end
end
end
end)
When I printed velocityTime it was decreasing but the player was frozen. If anyone can help, that would be great... It is a local script for localization

3 comments
the clone teleports also, but delay will get what happened 2 seconds ago right?? That is what you are saying
Because the player teleports to places and I need the clone to follow where they go, the teleporters become unavailable after being touched
It worked, thanks man, this can make all my time scripts infinitely easier to code!!