Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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:

01local plr = game:service("Players").LocalPlayer
02local userinputservice = game:service("UserInputService")
03local chest = workspace.Chests.LargeChest
04_G.distance = 4
05userinputservice.InputBegan:connect(function(inp)
06   if inp.KeyCode == Enum.KeyCode.T then
07       while wait() do
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
11           end
12       end
13   end
14end)

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!

0
Why are you looping through the chest in order to set the HumanoidRootPart's CFrame? y3_th 176 — 5y
0
But how can do else? Kalinka008 2 — 5y
0
How about not looping through the chest? y3_th 176 — 5y
0
Hm... I will try Kalinka008 2 — 5y
View all comments (2 more)
0
Dont work( Kalinka008 2 — 5y
0
Maybe its works, but maybe i do something not this way... Kalinka008 2 — 5y

Answer this question