When i execute script all works fine, but over time stops working. Script:

local plr = game:service("Players").LocalPlayer
local userinputservice = game:service("UserInputService")
local chest = workspace.Chests.LargeChest
_G.distance = 4
userinputservice.InputBegan:connect(function(inp)
   if inp.KeyCode == Enum.KeyCode.T then
       while wait() do
           for _,v in next, chest:GetChildren() do
               v.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.CFrame.X,plr.Character.HumanoidRootPart.CFrame.Y,plr.Character.HumanoidRootPart.CFrame.Z - _G.distance)
               v.HumanoidRootPart.Anchored = true
           end
       end
   end
end)

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!

6 comments

0

Why are you looping through the chest in order to set the HumanoidRootPart's CFrame?

0

But how can do else?

0

How about not looping through the chest?

0

Hm... I will try

0

Dont work(

0

Maybe its works, but maybe i do something not this way...