ive never had this error, neither changed anything in the scripts, but outta nowhere this error just pops up?
You can never rely on the script even if it theoretically shouldn’t have any issues, get used to checking everything if you don’t want your scripts ever breaking.
local HumanoidRootPart = workspace[Model]:FindFirstChild("HumanoidRootPart")
-- LINE 36 --
if HumanoidRootPart then
-- CONTINUE SCRIPT --
end
You have to reassign the variable when a new character gets added (such as when respawning).
Use WaitForChild
to get the HumanoidRootPart and this error will suddently disappear!
(You should give us more context about it, because the solution is different depending of what you do inside this module, such as the answer above and bellow)
I suggest using any character specific logic inside of a local script located in starter character scripts. This is because the character instance is different each time the users spawns. The error you are likely experiencing is caused by the fact that Roblox cleaned up the old Character instance meaning the humanoid root part no longer exists. To fix this you can update the character every time a new one is spawned, or, by simply making a local script in starter character scripts and adding the module import and using the character as a functional arg every time the script runs.
Yes it was a Roblox problem (i guess), happened to me as soon as i stopped the test and played again in studio
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.