Script in ServerScriptService
game.ReplicatedStorage.Main.Events.TaxValueChange.OnServerEvent:connect(function(plr) local amountB = plr.PlayerGui.HUD.TaxFrame.Frame.Amount wait(.5) plr:WaitForChild("Tax").Value = amountB.Text end)
LocalScript in a button
script.Parent.MouseButton1Click:connect(function(n) local amount = script.Parent.Parent.Amount local event = game.ReplicatedStorage.Main.Events.TaxValueChange event:FireServer("TaxThoseDuds",0) end)
Im using a TextBox to change the value of how much taxing is
Scripts do not have access to objects in the PlayerGui. Instead of reading the value on the server, it should be passed as an argument by the LocalScript:
event:FireServer(tonumber(player.PlayerGui.HUD.TaxFrame.Frame.Amount))