Howdy! I got a gun kit and heavily modified it, but after testing it out in game. I noticed it caused a lot of lag. I don’t know why or how it is happening.
if you help the gun kit is all yours!
Place:
Howdy! I got a gun kit and heavily modified it, but after testing it out in game. I noticed it caused a lot of lag. I don’t know why or how it is happening.
if you help the gun kit is all yours!
Place:
theres an infinite loop here in the SetUpGrip function in ReplicatedStorage.Modules.ToolsAndMelee Module
local Weld = Handle:FindFirstChildWhichIsA("Motor6D")
local slot2 = Character:FindFirstChild("Right Arm")
if Weld == nil then
repeat
wait(.1)
Weld = Handle:FindFirstChildWhichIsA("Motor6D")
until Weld
end
looks like your tool handle is supposed to have a motor6d and it doesn’t.
this is why its usually considered bad practice to have infinite loops like this that just check if something exists because they don’t leave an error message so it makes them extremely difficult to find. also these scripts look very outdated, they use deprecated things like Enum.RaycastFilterType.Blacklist and use wait() instead of task.wait().
I would be pretty shocked if this is the only problem you run into while using this module this was just the first thing I happen to notice.
it checking for a motor6D is because sometimes the script loads faster than the model. there is supposed to be a motor6d (I fixed it). I will update the waits and the blacklist.
Im pretty sure everything inside of starter pack will be loaded before the script runs but i could be wrong. if you do want to keep somthing like this i would just use waitforchild instead or at the very least put some sort of attempt tracker on the loop that stops it after like a second or 2. its pretty much NEVER a good idea to have a loop that can just repeat for ever.
I do agree. I should swap it.
I thought the same until I had all my weapons not working lol (they couldn’t find the motor6d)
swapped:
local Weld = Handle:FindFirstChildWhichIsA("Motor6D") or Handle:WaitForChild("Motor6D",5)
but the lag is still there.
I still stutter (not in vid but I do) and the bullets appear farther than usual after a few shots.