I have this script in a textbutton which is in a surface gui.
local button = script.Parent local internet = game.StarterGui.Screen.Internet local InternetSender = game.ReplicatedStorage.RemoteFunctions.Screen:FindFirstChild("InternetOn") local player = game.Players.LocalPlayer button.MouseButton1Click:Connect(function() InternetSender:FireClient(player) end)
I'm trying to make the script send a signal to a local script using the remote event but when I run it I get an error saying player argument must be a player object. How do you get the player object?
I think there are two problems here:
1.) LocalPlayer can only be accessed with a LocalScript, therefore the :FireClient(player)
would be firing nil.
2.) If you're using a LocalScript, :FireClient()
can only be accessed with a ServerScript, so it would not work.