Hey, guys so I have a huge problem on my hands right now that I have completely no solution to so I was hoping someone on here can help me out! Here is my problem:
I put a ScreenGui inside of StarterGui then I put FilteringEnabled on Workspace true and then I put a TextButton inside of the ScreenGui then I added a RemoteEvent inside of the TextButton and I added a LocalScript inside of the RemoteEvent so lemme draw the picture right here it looks something like this...
ServerScriptService
Script
StarterGui
ScreenGui
TextButton
RemoteEvent
LocalScipt
Above is my set up.... The problem is that when I do it in studio it works perfectly fine however, when I do it in-game it does not work for some completely unknown reason...
Here is my ServerScriptService Script:
--SERVER SCRIPT INSIDE OF SERVERSCRIPTSERVICE--
game.Players.PlayerAdded:connect(function(plr)
if plr then
local pg = plr:WaitForChild("PlayerGui")
local sg = pg:WaitForChild("ScreenGui")
local tb = sg:WaitForChild("TextButton")
local re = tb:WaitForChild("RemoteEvent")
tb.MouseButton1Click:connect(function()
local event = re
event:FireClient(plr)
end)
end
end)
Well now time for my script inside of the Remote Event:
--LOCAL SCRIPT INSIDE OF REMOTE EVENT--
script.Parent.OnClientEvent:connect(function()
print("Works!")
end)
Thank you so much I'd be eternally greatful to anyone that found out as to what is wrong with this! THANK YOU IN ADVANCE!
~~ KingLoneCat
