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

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

Asked by 5 years ago

**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:

0
Line 9 of localscript, change connect to Connect, line 11 of server script do the same User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

0
Thanks! It fixed in Studio. But in game I getting this error: ServerScriptService.DataChangeSelfCheckIn:12: attempt to index local 'DTBoxS' (a nil value) User#22595 0 — 5y
Ad

Answer this question