I am trying to make a surface gui button that opens up a screen gui, but when I insert a local script into the button in the surface gui, nothing happens. I tried to print hello world and nothing happened. Nothing printed, no errors, nothing, but when I move it into starterplayerscripts everything works just fine. Do local scripts work in surface gui or am I just doing something wrong? Heres the local script:
local button = script.Parent
local internet = game.StarterGui.Screen.Internet
local InternetSender = game.ReplicatedStorage.RemoteFunctions.Screen:FindFirstChild("InternetOn")
local function onInternetSender(player)
print(player)
InternetSender:FireClient(player)
end
button.MouseButton1Click:Connect(onInternetSender)

2 comments
Thank you :)
No problem.