So I am helping make a train game, and one of the features are boards on the platform which say where the train is going. At terminus stations, I want to save the specific train (traintrigger) in an object value and then display it's destination, so when it changes its destination the board will also update. Currently the traintrigger is saved in the value correctly, but it won't show the destination on the board. The script I have is below.
value = script.Parent.Value
gui = script.Parent.SurfaceGui.TextBox
function touched(eeeee)
if eeeee.Name == 'TRAINTRIGGER' then
value.Value = eeeee
end
end
script.Parent.Touched:Connect(touched)
while true do
gui.Text = script.Parent.Value.Value.destination.Value
wait()
end
