Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

RemoteEvent doesn't work in server side why?

Asked by 6 years ago

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

Log in to vote
1
Answered by 6 years ago

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

hope this helps

0
If you want to fire all the clients just use remoteevent:FireAllClients() xXRealFurryKittenXx 20 — 6y
0
So if i use FireAllClients() do i still have to have the player as the first parameter? ObStactionD3stroy3r 14 — 6y
0
I fixed it, thanks ObStactionD3stroy3r 14 — 6y
Ad

Answer this question