I want Rotu to follow you and it works but its slow
Heres a video
(won’t load)
You’ll have to play the game → HERE
Code:
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(char)
local Rotu = game.Workspace:WaitForChild("Rotu")
Rotu.Parent = game.Workspace
Rotu.Name = "Following:"..p.Name
Rotu.Anchored = false
Rotu.CanCollide = false
local bp = Instance.new("BodyPosition")
bp.Parent = Rotu
while wait() do
bp.Position = char:FindFirstChild("Head").Position + Vector3.new(3,2,0)
end
end)
end)
-- define the services (you can index tho)
local players = game:GetService("Players")
local runService = game:GetService("RunService")
players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(char)
local Rotu = workspace:WaitForChild("Rotu")
Rotu.Parent = workspace
-- use "workspace" because it's much easier and faster
Rotu.Name = "Following:"..p.Name
Rotu.Anchored = false
Rotu.CanCollide = false
local bp = Instance.new("BodyPosition")
bp.Parent = Rotu
runService.Heartbeat:Connect(function() -- use a runservice event instead of a while loop
bp.Position = char:FindFirstChild("Head").Position + Vector3.new(3,2,0)
end)
end)
end)
local players = game:GetService("Players")
local runService = game:GetService("RunService")
players.PlayerAdded:Connect(function(p)
local char = p.Character or p.CharacterAdded:Wait() -- the character might've loaded
local Rotu = workspace:WaitForChild("Rotu")
Rotu.Parent = workspace
Rotu.Name = "Following:"..p.Name
Rotu.Anchored = false
Rotu.CanCollide = false
local bp = Instance.new("BodyPosition")
bp.Parent = Rotu
runService.Heartbeat:Connect(function()
bp.Position = char:FindFirstChild("Head").Position + Vector3.new(3,2,0)
end)
end)
end)
Didnt work no print and instead of slowly descending it just stayed still. so its the entire script ? also the part Rout is a mesh part is that why its not working?
In my post I said that you should weld it to the player’s head. You’ll have to manually readjust the C0 or C1 of the weld to get it in the right position.
I don’t really know any thing about welding like what script or where to put the script and this doesn’t really help.
I’ve noticed the the script is a normal script but has local in it is that purposeful of a mistake. I’m new so don’t know much but try my best. This script might be outdated because i followed a tutorial but changed names to fit my game so that might be it. i hope this explanation will help find the problem.