An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
LOCAL SCRIPT
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
if table.find(PETS_LIST, v.Name) then
return v
end
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)
Original Link: https://dev.to/joinmoin0002/local-script-1hi7
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To