I’m currently building a train for a friend’s game, and there’s supposed to be a GUI that pops up when you sit in the drive seat, but for some reason, my gui works in the game in which my model was built, but not in a different game? The script that puts it on the screen is exactly the same, the model is the same, and the gui refuses to move to the PlayerGui, even with use of the console to attempt to move it manually.
I’ve used a series of print()s to see if the script was responding, and it did indeed detect when i sat, and also it managed to set the TrainOperator value, and yet the GUI itself just refuses to move.
Take a look at your PlayerGui in the game where it doesn’t work, verify that the gui is inside it and check if the .Enabled property is false for some reason. You should be able to mess around at run time to figure out how to get it to show up, or otherwise give clues as to what’s going wrong (i.e. if it’s not in your PlayerGui, then something isn’t working with listening to the event or validating the event)
i’ve used prints to test for all these, and they all returned
the issue here is that script works in one game, but not another for an unknown reason, without anything at all in the console? i have a feeling this may be a roblox bug
I’m having a hard time understanding how all those can be printing correctly yet the Gui isn’t showing up in your PlayerGui. Can you do another screen recording of this, especially showing the gui showing up in PlayerGui but not being visible to you?
Ah… perhaps there is an ephemeral duplicate SeatWeld created and removed that is removing the script after being parented. Try adding some prints to the ChildRemoved function as well to see if that’s the case
Perhaps the Train.Parent = script.Parent and script.Parent:SetNetworkOwnershipAuto() should also be inside that if statement.
If you notice in your logs, there’s another A printing, indicating a second child is added. This makes me suspicious that the “other thing” could also be getting removed, which runs your onChildRemoved function, and reparents your script regardless of whether or not it was a SeatWeld
I’m not sure why the behavior is inconsistent with your original place, though. You could add a print to figure out what that other thing being added is and it might give you a clue, but regardless making the change makes the system more robust and seems to fix the issue