Made a little pet script, however, it won't be able to rotate.
01 | local plr = game.Players.LocalPlayer |
02 | local char = plr.CharacterAdded:wait() |
03 | torso = char:WaitForChild( 'Torso' ) |
04 | local ServerStorage = game:GetService( 'ServerStorage' ) |
05 |
06 | Pets = ServerStorage:WaitForChild( 'Pets' ) |
07 | dog = Pets:WaitForChild( 'Annoying Dog' ) |
08 | oldrot = Vector 3. new( 90 , 180 , 90 ) -- Rotation |
09 |
10 | dog.Parent = char |
11 |
12 | Gyro = Instance.new( 'BodyGyro' ,dog) |
13 | while wait() do |
14 | Gyro.MaxTorque = Vector 3. new( math.huge , math.huge , math.huge ) |
15 | oldpos = torso.CFrame * CFrame.new( 0 ,- 2 ,- 4 ) |
16 | dog.Rotation = Vector 3. new( 90 , 180 , 90 ) |
17 | dog.Rotation = oldrot |
18 | dog.CFrame = oldpos |
19 | Gyro.CFrame = torso.CFrame |
20 | end |
It works, just rotation property of part isn't working. pet is a union
It seems like you want the dog to hover around the player's head.
Use a combination of BodyPosition
s and BodyGyro
s.
01 | local plr = game.Players.LocalPlayer |
02 | local char = plr.CharacterAdded:wait() |
03 | local torso = char:WaitForChild( 'Torso' ) |
04 | local head = char:WaitForChild( 'Head' ) |
05 | local ServerStorage = game:GetService( 'ServerStorage' ) |
06 |
07 | local Pets = ServerStorage:WaitForChild( 'Pets' ) |
08 | local dog = Pets:WaitForChild( 'Annoying Dog' ) |
09 |
10 | local newpet = dog:Clone() |
11 | newpet.Parent = workspace |
12 |
13 | local bgyro = Instance.new( 'BodyGyro' , newpet) |
14 | bgyro.MaxTorque = Vector 3. new( math.huge , math.huge , math.huge ) |
15 |