Remote Event not sending inputted data to server correctly

Hiya devs, so I am having an issue where when I try to send 4 strings to the server, but the issue isnt that its not sending the strings its sending the wrong information (What its set to as defult)

Local Script

local ArrivalTime = script.Parent.ETA.Text
local DestinationAirport = script.Parent.Dest.Text
local DepartureAirport = script.Parent.Depart.Text
local Status = script.Parent.Completion.Text

script.Parent.Submit.MouseButton1Click:Connect(function()

	IFEevent:FireServer(ArrivalTime,DepartureAirport, DestinationAirport, Status)
end)

Server Script

local IFEevent = game.ReplicatedStorage.IFE

IFEevent.OnServerEvent:Connect(function(ArrivalTime, DestinationAirport, DepartureAirport, Status)

	
	print(ArrivalTime, DestinationAirport, DepartureAirport, Status)
end)

When I input the data as follows
image

It comes out on the outout as

 Bear23913 00:00 RVN RVN  -

Where as with this it should come out as

 Bear23913 12:00 HEL RVN 10%
1 Like

Try assigning the ArrivalTime, DestinationAirport, DepartureAirport and Status variables inside the MouseButton1Click event, so they’re updated when you click the button & before the values are sent to the server

script.Parent.Submit.MouseButton1Click:Connect(function()
	local ArrivalTime = script.Parent.ETA.Text
	local DestinationAirport = script.Parent.Dest.Text
	local DepartureAirport = script.Parent.Depart.Text
	local Status = script.Parent.Completion.Text

	IFEevent:FireServer(ArrivalTime,DepartureAirport, DestinationAirport, Status)
end)

That works, however for some reason the status only returns as “-”

The first argument passed in .OnServerEvent is the player who fired the event, which is not declared in your script

try:

local IFEevent = game.ReplicatedStorage.IFE

IFEevent.OnServerEvent:Connect(function(Player, ArrivalTime, DestinationAirport, DepartureAirport, Status)

	
	print(ArrivalTime, DestinationAirport, DepartureAirport, Status)
end)

Thank you very much this solved the issues!

1 Like