HumanoidRootPart is not a valid of Model. How fix?
Asked by
5 years ago Edited 5 years ago
When i execute script all works fine, but over time stops working.
Script:
01 | local plr = game:service( "Players" ).LocalPlayer |
02 | local userinputservice = game:service( "UserInputService" ) |
03 | local chest = workspace.Chests.LargeChest |
05 | userinputservice.InputBegan:connect( function (inp) |
06 | if inp.KeyCode = = Enum.KeyCode.T then |
08 | for _,v in next , chest:GetChildren() do |
09 | v.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.CFrame.X,plr.Character.HumanoidRootPart.CFrame.Y,plr.Character.HumanoidRootPart.CFrame.Z - _G.distance) |
10 | v.HumanoidRootPart.Anchored = true |
The problem is that through time writes: HumanoidRootPart is not a valid of Model.
Help pls!
PS: Click view source to see all script, becouse website dont show to end!