Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PLAYER = game.Players.LocalPlayer
- local PET = PLAYER:WaitForChild("EQUIPPED_PET", true)
- local PETS_LIST = require(game.ReplicatedStorage.PETS_LIST)
- local STEPPED = nil
- local POS = nil
- local GYR = nil
- local function GET_PET(CHAR, NAME)
- for _, v in pairs(CHAR:GetChildren()) do
- if v:IsA("BasePart") and table.find(PETS_LIST, v.Name) then
- return v
- end
- end
- end
- local function GET_MOVERS(PET)
- for _, v in pairs(PET:GetChildren()) do
- warn(v.ClassName)
- if v:IsA("BodyPosition") then
- POS = v
- end
- if v:IsA("BodyGyro") then
- GYR = v
- end
- end
- end
- PET.Changed:Connect(function(NAME)
- local PET = GET_PET(PLAYER.Character, NAME)
- print(PET)
- if PET ~= nil then
- GET_MOVERS(PET)
- print(POS, GYR)
- if STEPPED then
- STEPPED:Disconnect()
- end
- STEPPED = game:GetService("RunService").Stepped:Connect(function()
- if PLAYER.Character.Humanoid.Health > 0 then
- local DEST = CFrame.new(PLAYER.Character.Head.CFrame * Vector3.new(1, 0, 2)).p
- local CF = PLAYER.Character.Head.CFrame
- POS.Position = DEST
- print(POS.Position)
- GYR.CFrame = CF
- else
- if STEPPED then
- STEPPED:Disconnect()
- end
- POS.MaxForce = Vector3.new(0, 0, 0)
- POS = nil
- GYR = nil
- end
- end)
- end
- end)
Add Comment
Please, Sign In to add comment