Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local char = script.Parent.Parent
- local hum = char:FindFirstChild("Humanoid")
- local Head = char:FindFirstChild("Head")
- local pet = script.Parent
- local maxFloat = 1
- local floatInc = 0.025
- local sw = false
- local fl = 0
- while true do
- wait()
- if not sw then
- fl = fl + floatInc
- if fl >= maxFloat then
- sw = true
- end
- else
- fl = fl - floatInc
- if fl <=-maxFloat then
- sw = false
- end
- end
- if pet ~= nil and hum ~= nil and Head ~= nil then
- if hum.Health >= 0 then
- local cf = Head.CFrame * CFrame.new(3,2+fl,3)
- pet.BodyPosition.Position = Vector3.new(cf.x,cf.y,cf.z)
- pet.BodyGyro.CFrame = Head.CFrame * CFrame.new(3,0,-3)
- else
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement