Bulldo344
(LawMixer)
April 7, 2023, 9:51pm
#1
Getting “Something unexpectedly tried to set the parent of MP5SD to Backpack while trying to set the parent of MP5SD. Current parent is Bulldo344.” while unequipping and swapping tools.
I found out, that the tool has to be in player’s Backpack, and it cannot be in ServerStorage or anything, so I parent that before it gets equipped, but unequipping, I’m checking that everytime I equip something.
(coded retracted by author)
mc7oof
(oof)
April 7, 2023, 9:52pm
#2
That message happens when you try and reset a parent too quickly.
Add a task.wait()
Bulldo344
(LawMixer)
April 7, 2023, 10:01pm
#3
If I do that, it will start unequipping and equipping tools, and start to glitch out.
External Media
mc7oof
(oof)
April 7, 2023, 10:05pm
#4
The wait
can be between calling functions that change the parent.
Do not add it to a for
loop.
Bulldo344
(LawMixer)
April 7, 2023, 10:07pm
#5
It still happens, maybe I’m doing it wrong? Could you provide a example of what you mean, maybe I’m not following what your saying?
mc7oof
(oof)
April 7, 2023, 10:09pm
#6
What line of code is in the output window with the error message?
Bulldo344
(LawMixer)
April 7, 2023, 10:11pm
#7
There’s no error messages, warnings, anything. It’s just unequipping and equipping repeatly, but it solves the problem I was first having.
mc7oof
(oof)
April 7, 2023, 10:12pm
#8
Put a print statement at the start of the functions you think are causing the problem.
Watch the output and see if you can figure out which function is looping the equip/uneqip.
Its print statement should be repeating in the output window.
Bulldo344
(LawMixer)
April 7, 2023, 10:32pm
#9
I added a debounce, and waited 2 seconds to turn the debounce off.
system
(system)
Closed
April 21, 2023, 10:32pm
#10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.