Help with a trading Gui

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want to make a System where when one Client Clicks a Button another Client will See a UI

  2. What is the issue? Include screenshots/videos if possible!
    It either won’t send to the Client or it will only send to the Client that sent it.
    https://www.youtube.com/watch?v=Wnu96HFKWwA&feature=youtu.be

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried remote Events and I did look for Solutions on Developer hub.

Local Script in the Button


script.Parent.Send.Button.MouseButton1Click:Connect(function()
	local mainFrame = script.Parent.Parent.Parent.Parent.Parent.TradeSent
	mainFrame.TradeSent.Desc.Text = "Trade Sent!"	
	script.Parent.Parent.Parent.Parent.Visible = false
	local name = script.Parent.Name
	mainFrame.Visible = true	
	local player1 = game.Players:FindFirstChild(name)
	game.ReplicatedStorage.Events.NewTrade:FireServer(name)
end)

Script in ServerScriptService

game.ReplicatedStorage.Events.NewTrade.OnServerEvent:Connect(function(name)
	local player = game.Players:FindFirstChild(name)
	player.PlayerGui.TradingUI.TradeQuestion.Visible = true
end)

Thank you!

Hello! when passing on OnServerEvent you need to include the player whom fired the event or it can lead to errors.

So this:

game.ReplicatedStorage.Events.NewTrade.OnServerEvent:Connect(function(Player, name)

The on server event is picking up name as the defined player so when your finding the player with the parameter ‘name’ it is finding the player which is sending the event. so if you put my code in which I stated up there ^ it should fix your problem! any more problems let me know! :slight_smile:

Also happy birthday!

Thank you So MUCH!! And Thank you!

Always happy to help! any more problems be sure to message me :slight_smile: