local function update(player,info,Status,Time,Gate,Destination,Aircraft,Flightnum)
print("ClientRecieved")
print(player.Name)
end
remote.OnClientEvent:Connect(update)
The client receiver doesn’t seem to work for some reason.
The client already knows who the player is with local player = game.Player.LocalPlayer so it doesn’t need to send the player from the server to the client.
local player = game.Player.LocalPlayer
local function update(info,Status,Time,Gate,Destination,Aircraft,Flightnum)
print("ClientRecieved")
print(player.Name)
end
remote.OnClientEvent:Connect(update)
You will still have to keep player in the parameters in the FireClient(player… because then the server knows who to send it to.
It is because the first parameter of your update function: “player”. Since the remote is fired towards a client, you do not need to index the player target from the receiving client.
U forgot an S in player but it still doesn’t receive anything.
I put these together so Idk if it causes a problem?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.SCI
local player = game.Players.LocalPlayer
---------------------------------------------------------------------
while true do
remote:FireServer("flightinfo")
print("FiredServer")
wait(30)
end
local function update(info,Status,Time,Gate,Destination,Aircraft,Flightnum)
print("ClientRecieved")
print(player.Name)
end
remote.OnClientEvent:Connect(update)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.SCI
local player = game.Players.LocalPlayer
---------------------------------------------------------------------
local function update(info,Status,Time,Gate,Destination,Aircraft,Flightnum)
print("ClientRecieved")
print(player.Name)
end
while true do
remote:FireServer("flightinfo")
print("FiredServer")
remote.OnClientEvent:Connect(update)
wait(30)
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.SCI
local player = game.Players.LocalPlayer
---------------------------------------------------------------------
local function update(info,Status,Time,Gate,Destination,Aircraft,Flightnum)
print("ClientRecieved")
print(player.Name)
end
remote.OnClientEvent:Connect(update)
while true do
remote:FireServer("flightinfo")
print("FiredServer")
wait(30)
end
Put your while loop at the very end. No other code is being read because it is in front of it all.
also do not do this because every 30 seconds it’ll create a new event for remote and then when the server fires to the client the client will fire multiple times
Like this. Look at the difference. The remote.OnClientEvent:Connect(update) is before the while loop and not in it.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.SCI
local player = game.Players.LocalPlayer
---------------------------------------------------------------------
local function update(info,Status,Time,Gate,Destination,Aircraft,Flightnum)
print("ClientRecieved")
print(player.Name)
end
remote.OnClientEvent:Connect(update)
while true do
remote:FireServer("flightinfo")
print("FiredServer")
wait(30)
end