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

FilteringEnabled script and Remote Events really confusing me?

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

0

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.

0

^ I'm not that stupid, I'm aware that I am using a string value.

0

What. 'tostring' doesn't need a string value, the whole point of 'tostring' is to transform a non-string value INTO a string.

1 answer

✓ Accepted answer

You seem to be sending a 'player' argument to the server. This is unnecessary, as the client is always the first argument passed. No need to pass it manually (:

So subsequently, your 'row' parameter on the server script is actually another player object.

LocalScript;

workspace.RemoteEvents.BaggageGUI:FireServer(row,column);

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