local service = game:GetService("TweenService") local ti = TweenInfo.new( 0.05, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0 ) game.Players.PlayerAdded:connect(function(plr) wait(2) local part = game.ReplicatedStorage.Cat:Clone() part.Parent = workspace[plr.Name].Torso part.CanCollide = false part.Anchored = true while true do wait(0.05) local position = {CFrame = CFrame.new(plr.Character['Head'].Position + Vector3.new(2,1,0))} local movepet = service:Create(part,ti,position) movepet:Play() part.Rotation = game.Workspace[plr.Name].Torso.Rotation end end)
Here is my script. This is a pet script which follows you. how can i fix this?. its a Script. If I would make it as a LocalScript in a player, Only you would see it. Please tell a way to fix this.
Alright,
Add a mesh to "ReplicatedStorage", and make the mesh ID what ever you would like.
Name the mesh, "Pet".
Insert a LocalScript into "StarterGui".
Inside of the script, add this piece of code:
local plr = game.Players.LocalPlayer wait(2) local part = Instance.new("Part", workspace[plr.Name].Torso) part.CanCollide = false part.Anchored = true part.Size = Vector3.new(1, 1, 1) local mesh = game.ReplicatedStorage.Pet mesh:Clone().Parent = part local direction = CFrame.new(part.Position, plr.Character['Left Leg'].Position).lookVector local increment = direction * 4 while true do wait() part.CFrame = game.Workspace[plr.Name]['Torso'].CFrame + (direction * increment) + Vector3.new(-5, 0, 0) part.Rotation = game.Workspace[plr.Name]['Torso'].Rotation + (direction * increment) + Vector3.new(-1, -2, increment) end