✓ Accepted answer
Server Script do not work in Client Locations. This includes StarterGui and PlayerGui. You attempted on placing the ServerScript in the TextButton and you made no attempt of cloning it to a Workspace or any other Server Communicating location. Consider placing the Server Script in Workspace.
Remote Events are usually placed in ReplicatedStorage simply because both Client and Server can access them. In your case, you implemented in the strictly client location that is StarterGui. Consider placing most of your Remote Event in ReplicatedStorage.
Client Script
local Player = game:GetService("Players").LocalPlayer;
local ReplicatedStorage = game:GetService("ReplicatedStorage");
local PlayerGui = Player:WaitForChild("PlayerGui");
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent");
local ScreenGui = PlayerGui:WaitForChild("ScreenGui");
local TextButton = ScreenGui:WaitForChild("TextButton");
Click = function()
RemoteEvent:FireServer();
end;
TextButton.MouseButton1Down:Connect(Click);
Remote Event in ReplicatedStorage
Server Script
local ReplicatedStorage = game:GetService("ReplicatedStorage");
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent");
OnSevEvent = function()
print("I was called");
end;
RemoteEvent.OnServerEvent:Connect(OnSevEvent);
Should you have any questions, feel free to comment below.
5 comments
are there any errors in the output?
^ He literally said he is getting no errors from the output.
lol rip
Send a picture of your stuff. I don't know what those
parentsare so..https://gyazo.com/be4b6068879c1bdaa05ec358de0931f8