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

RemoteEvent doesn't work in server side why?

So this script works when i click the play button in roblox studio but when i upload the game and press play on the website the remoteevents dosen't work for some reason why?

This is the error i got:

06:37:56.375 - FireClient: player argument must be a Player object
06:37:56.376 - Stack Begin
06:37:56.376 - Script 'ServerScriptService.GameScript', Line 46 - global Intermission
06:37:56.377 - Script 'ServerScriptService.GameScript', Line 224
06:37:56.377 - Stack End

Server Script:

game.ReplicatedStorage.ServerRequest.Notification:FireClient("The game is now in progress")

Client Script:

reg.Notification.OnClientEvent:connect(function(player, val, txt)
	local Noti = script.Parent.Notifications
	Noti.Visible = true
	Noti:TweenPosition(UDim2.new(0.5, -200, 0.95, 0),"Out", "Bounce", 0.7)
	wait(0.1)
	Noti.Test:TweenPosition(UDim2.new(0, 0, 0, 0),"Out", "Bounce", 0.7)
	Noti.Shadow:TweenPosition(UDim2.new(0, 1, 0, 1),"Out", "Quad", 0.7)
	Noti.Test.Text = player
	Noti.Shadow.Text = player
	wait(3)
	Noti.Test:TweenPosition(UDim2.new(0, 0, 1, 0),"In", "Quad", 0.7)
	Noti.Shadow:TweenPosition(UDim2.new(0, 1, 1, 1),"In", "Quad", 0.7)
	wait(0.5)
	Noti:TweenPosition(UDim2.new(0.5, -200, 1, 0),"In", "Bounce", 0.7)
	wait(1)
	Noti.Visible = false
	
end)

1 answer

✓ Accepted answer

When firing the client you have to put the player as the first parameter to define who's client to fire.

hope this helps

3 comments

0

If you want to fire all the clients just use remoteevent:FireAllClients()

0

So if i use FireAllClients() do i still have to have the player as the first parameter?

0

I fixed it, thanks

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