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

"FireClient" not firing at all?

Hello,

game.Players.PlayerRemoving:Connect(function(player)

wins = wins + 1

WinCounter:FireClient(player, wins)
	
end)

is my script, where "wins" is zero before the script is run.

I fire to this local script;

WinCounter.OnClientEvent:Connect(function(player, wins)
	
	script.Parent.Frame.TextLabel.Text = "Wins: " ..  wins
	
end)

It doesn't give me any errors at all and I know it's not firing because I used print statements. Can someone please help me?

2 comments

0

Are you aware of the functionality of the PlayerRemoving signal?

0

I assumed it fires when a player has left the game?

1 answer

Here is an article of remote events click here The event FireClient is used to fire clients from a server to a local script. One thing to point out is that you have to connect FireClient to a remote event also. Your code is invalid because you have to put your first script in a server script.

Edit: There is one reason I can only think of is tostring. To string converts a number of pretty much anything into a string.

7 comments

0

The first script is in a server script, and I've already tried FireAllClients.

0

Make sure your remote event is in replicated storage

0

I also know how remote events work, and WinCounter is the remote event that FireClient is connected to.

0

onServerEvent is only used when a client is firing to the server.

0

Wheres the local script location.

0

Also on your first script try wins.Value = wins.Value +1

0

superneebo I dont know whats wrong with your code. The only option is to add a tostring at line 3 otherwise I dont know.

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