I'm trying to make a trading system cuz I'm bored and I use a chatted command to open up the trade gui. Now it only works once but if I close the gui using the close button i made, it doesn't work again. Here's the code.
Client Side:
local player = game.Players.LocalPlayer
local playCommand = "?trade"
local remote = game.ReplicatedStorage:WaitForChild("openning")
player.Chatted:Connect(function(msg)
if string.lower(msg) == playCommand then
print("gtsgdsgh")
remote:FireServer()
end
end)
server side:
game.ReplicatedStorage.openning.OnServerEvent:Connect(function(player)
if player.PlayerGui.TradeGui.Enabled == false then
player.PlayerGui.TradeGui.Enabled = true
end
end)
Quick note, i tried to use player added on a server script to do it but that didn't work too and it always prints in output when i say ?trade but it only fires the remote event once.

1 comment
Why are you manipulating the GUI using a server script?