local Players = game:GetService("Players")
script.Parent.TextButton.MouseButton1Click:Connect(function()
Players.LocalPlayer.PlayerGui.ShopGui.Enabled = false
if Players.LocalPlayer.PlayerGui.PlayerStats.Iron.Value >= 1 then
game.ReplicatedStorage.PurchaseWeapon:FireServer()
end
end)
You would need to use a RemoteEvent in your Triggered method to achieve this. Since you’ve changed the ShopGui client side the server still thinks it is already enabled so it doesn’t do anything.
I guess you could also just set it to false and then true in your code and that would work.