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

I have problem with RemoteEvent scripts. Can you help me?

**I don't know my mistake D: Help please. **

FireEvent Code: (Local Script)

local SelfCheckInEvent = game.ReplicatedStorage.SelfCheckInSystem.Events:WaitForChild("EditData")
local SumbitSCI = script.Parent.SelfCheckInDataMenu.Sumbit
local DTBoxS = script.Parent.SelfCheckInDataMenu.DepartureTimeBox.Text
local DBoxS = script.Parent.SelfCheckInDataMenu.DestinationBox.Text
local FBoxS = script.Parent.SelfCheckInDataMenu.FlightBox.Text
local GBoxS = script.Parent.SelfCheckInDataMenu.GateBox.Text
local PBoxS = script.Parent.SelfCheckInDataMenu.PlaneBox.Text

SumbitSCI.MouseButton1Click:connect(function()
	SelfCheckInEvent:FireServer(DTBoxS,DBoxS,FBoxS,GBoxS,PBoxS)
end)

OnServerEvent Code:

local EventSelfCheckIn = game.ReplicatedStorage.SelfCheckInSystem.Events.EditData

local Data = game.ReplicatedStorage.SelfCheckInSystem.Data
local DepartureTime = Data.DepartureTime
local Destination = Data.Destination
local Flight = Data.Flight
local Gate = Data.Gate
local Plane = Data.Plane


EventSelfCheckIn.OnServerEvent:connect(function(Player,DTBoxS,DBoxS,FBoxS,GBoxS,PBoxS)
    DepartureTime.Value = DTBoxS.Text
	Destination.Value = DBoxS.Text
	Flight.Value = FBoxS.Text
	Gate.Value = GBoxS.Text
	Plane.Value = PBoxS.Text
end)

I'm not good scripter D:

1 comment

0

Line 9 of localscript, change connect to Connect, line 11 of server script do the same

1 answer

✓ Accepted answer

In lines 3-7, remove the .Text part in your variables, then it should save the object, and not the string value of the Text property.

1 comment

0

Thanks! It fixed in Studio. But in game I getting this error: ServerScriptService.DataChangeSelfCheckIn:12: attempt to index local 'DTBoxS' (a nil value)

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