GUIButton not working?

Hello. I’ve got a couple of GuiObject functions here.

Code

In this code, the functions do not activate, and for some reason the vg.Parent is nil, as in it’s not apart of the frame, even though it shows up on the screen. It’s inside a PlayerAdded function inside a script located in ServerScriptService.

Explorer Hierarchy:

Anteckning 2020-04-21 145524

Inside a ScreenGUI of course. ^ is how the PlayerGui looks, so the GuiObjects are obviously existing, aswell as their parented properly. I have no idea what the problem is.

The server cannot see Player input, therefore these events will never fire.
You’ll need to use these in a LocalScript, this LocalScript should be inside your UI.

Yea, I thought that too, but I tried the exact same thing in another test place, and I received the correct results.
Also, the parent of the object should still be the frame, and the script should read that.