So I'm trying to make a button that changes the player's GUI upon click, but whenever I attempt to do so, it comes up with weird errors that I have no clue to fix.
--Inside the button script
local function bag(player,row,column,free)
if free.Value then
workspace.RemoteEvents.BaggageGUI:FireServer(player,row,column);
--free.Value = false
end;
end;
for i,v in pairs(script.PlaceBags:GetChildren()) do
v.ClickDetector.MouseClick:connect(function(player)
bag(player,v.Row.Value,v.Column.Value,v.Free);
end);
end;
--Inside the ServerScriptService Script
game.Workspace.RemoteEvents.BaggageGUI.OnServerEvent:connect(function(player,row,column)
local playerg = game.Players[player.Name].PlayerGui;
local gui = playerg.Baggage.Container
gui.Row.Text = tostring(row)
gui.Column.Text = tostring(column)
end);
One of the recent errors I got was
10:19:11.247 - Workspace.MainFunctions.PlaceBag:4: bad argument #3 to 'Value' (string expected, got boolean)
10:19:11.248 - Stack Begin
10:19:11.249 - Script 'Workspace.MainFunctions.PlaceBag', Line 4 - upvalue bag
10:19:11.249 - Script 'Workspace.MainFunctions.PlaceBag', Line 10
10:19:11.249 - Stack End

3 comments
for the 1st error where it says string expected, got boolean, it states that row.Value is either true or false. And tostring needs a string value.
^ I'm not that stupid, I'm aware that I am using a string value.
What. 'tostring' doesn't need a string value, the whole point of 'tostring' is to transform a non-string value INTO a string.