Briicks
|
  |
| Joined: 03 Apr 2015 |
| Total Posts: 1796 |
|
|
| 27 Jan 2017 05:26 PM |
So my game is FE and I know it has something to do with that but I'm not too sure why this isn't working. It's suppose to go thru all the players in the game and see if they have a Model named Pet in their workspace character and if so make it look like their pet if following that user locally.
game:GetService("RunService").RenderStepped:connect(function() for _,p in pairs(game.Players:GetChildren()) do if workspace:FindFirstChild(p.Name) then local Pl = workspace:FindFirstChild(p.Name) if Pl:FindFirstChild("Pet") then local Pet = Pl.Pet Pet.BS.position = Pl.HumanoidRootPart.Position + Vector3.new(0,0.10,5) Pet.BG.cframe = Pl.HumanoidRootPart.CFrame Pet.CFrame = CFrame.new(Pet.CFrame.p,Cam.CFrame.p) Pet.Anchored = false end end end end)
|
|
|
| Report Abuse |
|
|
Briicks
|
  |
| Joined: 03 Apr 2015 |
| Total Posts: 1796 |
|
|
| 27 Jan 2017 05:27 PM |
BS = BodyPosition BG = BodyGyro
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2017 05:37 PM |
If your doing this for every player then this will cause huge amounts of lag. Roblox servers arent that goid lmao. Yoyr better off moving the pet in a localscript and firing the server the position of the pet.
You can use lerp to achieve smoother effects. |
|
|
| Report Abuse |
|
|
Briicks
|
  |
| Joined: 03 Apr 2015 |
| Total Posts: 1796 |
|
|
| 27 Jan 2017 05:38 PM |
This isn't for a game of mine, so I don't care how much lag it causes. It works when testing in studio, but not in game.
|
|
|
| Report Abuse |
|
|