#why this code won't work?
26 messages · Page 1 of 1 (latest)
local NewPet = script.Parent NewPet.CanCollide = false
local PetPos = Instance.new("BodyPosition", NewPet)
local PetGyro = Instance.new("BodyGyro", NewPet)
PetGyro.MaxTorque = Vector3.new(400000,400000,400000)
local Owner = "Evanove68"
while(1) do
task.wait()
local OwnerObj = workspace:WaitForChild(Owner)
local OwnerPos = OwnerObj.HumanoidRootPart.Position
local StopAt = ((OwnerPos NewPet.Position) . magnitude 5) * 1000
PetPos.P = StopAt
PetPos.Position = OwnerPos + Vector3.new(0,10,0)
PetGyro.CFrame = OwnerObj.HumanoidRootPart.CFrame
end
still don't work
the 5 is suppoed to be
its cause of the random 5
maybe you forgot a symbol or soemthing
id
k
i don't think it's the 5, because the book had no previous errors for the script and i verified everything in the code, maybe roblox changed how the code work?
i will still try
maybe
** You are now Level 3! **
oh thats working without ownerpos and the 5 now
idk why it was written on the book
so thanks for helping
yeah well what you did with the 5 and ownerpos was like putting mayonaisse in shakespear macbet
(OwnerPos NewPet.Position) there should be a - in there
try not to rely too much on the book. I always try to understand everything that I write.