Unable to assign property Text. string expected, got Instance

  1. What do you want to achieve? Keep it simple and clear!
    So I own a hybrid airline similar to the likes of flyNorse or flydubai called FlyVox. I have been developing Manchester Airport (MAN) for it and creating some systems in house, like the gate system.

  2. What is the issue? Include screenshots / videos if possible!
    After scripting the update button which works fine with a remote event, I have tried scripting the receiver that then transmits the values to the surfacegui’s on the screens at the gate. There are 3 screens in all that are in a model called “SCREENS”. For some reason I get an error from line 8 and error message “Unable to assign property Text. string expected, got Instance” which directs me to Line 8 of the script.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried to rescript the entire system yet I still run into this flaw.

The system needs to work as otherwise my flights could be delayed due to wrong information getting to passengers and with Manchester being a silent airport, only announcing final call, I can’t realistically use the tannoy.

This is the script in question.

UpdateEvent = script.Parent.RemoteEvent
local group = script.Parent.SCREENS

UpdateEvent.OnServerEvent:Connect(function(DepTime, Remarks, FltNum, Dest)
	for _, a in ipairs(group:GetChildren()) do
		local guis = a:GetChildren()
		for _, b in pairs(guis) do
			b.Frame.Time.Text = DepTime
			b.Frame.Status.TextLabel.Text = Remarks
			b.Frame.OpFlightNo.Text = FltNum
			b.Frame.Dest.Text = Dest
		end
	end
end)

Here is where everything sits in explorer:
image

Any help appreciated

3 Likes

First argument is the player, so deptime is the player.

3 Likes

So before Deptime add plr right?

3 Likes

Yeah, that should be able to work.

1 Like

Didn’t work, no errors in the log

Try printing the DepTime and see what it prints out

Try this code:

 UpdateEvent = script.Parent.RemoteEvent
local group = script.Parent.SCREENS

UpdateEvent.OnServerEvent:Connect(function(Player, DepTime, Remarks, FltNum, Dest)
	for _, a in ipairs(group:GetChildren()) do
		local guis = a:GetChildren()
		for _, b in pairs(guis) do
			b.Frame.Time.Text = DepTime
			b.Frame.Status.TextLabel.Text = Remarks
			b.Frame.OpFlightNo.Text = FltNum
			b.Frame.Dest.Text = Dest
		end
	end
end)

if it doesn’t work then please show us the code where you are firing the RemoteEvent from.

The error suggests that the value being assigned to the Text property is not a string. Make sure that DepTime , Remarks , FltNum , and Dest are all strings before they are assigned to the GUI elements.