Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

RemoteEvent FireServer isn't working or showing up on all screens. May I get help?

FILTERING ENABLED IS ON

ServerScript in Workspace:

local remote = game.ReplicatedStorage.Give

remote.OnServerEvent:Connect(function(Player)
	game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value +1
end)

LocalScript in StarterGui:

local remote = game.ReplicatedStorage.Give

game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()
	remote:FireServer(1)
end)

In output it says "21:58:54.737 - exception while signaling: InsertService cannot be used to load assets from the client" I have no clue what that means. My cash on the leaderboard always stays as 0 when I click too. How do I fix this?

1 comment

0

is there more to the script? post the full one if so

1 answer

✓ Accepted answer

In the ServerScript, you are asking for game.Players.LocalPlayer, but the LocalPlayer can only be accessed from LocalScripts (Hence Local Local Localllssss). Also, A RemoteEvent always passes the Player as the first argument so you probably don't want to put (1) on the Client-side.

Server Script:

local remote = game.ReplicatedStorage.Give

remote.OnServerEvent:Connect(function(Player)
	Plr = (Stuff for finding the player's leaderstats but I am rushed for time lol)	
	if Plr then 
		Plr.leaderstats.Cash.Value = Plr.leaderstats.Cash.Value + 1
	end
end)

Local:

local remote = game.ReplicatedStorage.Give
	 	 
game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()	 
        remote:FireServer() -- No "1" because we don't have an argument for it on the server side.
end)

Hope I could point you in the right direction!

This discussion is preserved as it was. New answers, comments, and votes are closed.