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

How Can I Make A Trading GUI? (Like A Tool Trade Gui)

Because I Can't Seem To Figure Out How I Can Make One And Its Really Complicated And I Can't Find Any Tutorials At All! Is It Even Posible To Make One Anymore For Tools?

Like For Example, You Select An Item To Trade By Selecting A Tool And It Updates A Value Inside The Player Called "ToolSelected" Is It Posible?

For Example:

--Trade Value
game.Players.PlayerAdded:Connect(function(player)
 local TV = instance.new("StringValue", player)
 TV.Name = "ToolSelected"
 TV.Value = "Nothing"
end)

I Dont Really Know How To Make Rest

2 comments

0

this is not a script requesting site...

0

im not requesting, i want someone to explain

1 answer

✓ Accepted answer

Use RemoteEvents.

RemoteEvents can be used to communicate with the client and the server or server to client, or even client to client and server to server!

RemoteEvents can also be used to manipulate GUIs.

local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent

local Label = script.Parent

RemoteEvent.OnClientEvent:Connect(function()
	Label.Text = "Hello World!"
end)

In the code above is about a hypothetical situation in which you have a RemoteEvent, and you want it so that every time its fired it changes a TextLabel's text to "Hello World!".

To do this, we have a LocalScript located inside of a TextLabel, and whenever the RemoteEvent is fired and the RemoteEvent wants to affect the client then we immediately change the Text to "Hello World!"

We'll have a script in ServerScriptService to fire the RemoteEvent for all of the clients.

game:GetService("ReplicatedStorage").RemoteEvent:FireAllClients()

There's also FireClient() for RemoteEvents that can allow changes for a specific player.

We just need to tweak the code a bit.

game:GetService("ReplicatedStorage").RemoteEvent:FireClient(game.Players.Mr_Unlucky)

Now with this we make it so that a specific player sees that the TextLabel on their screen now says "Hello World!", and this change does not appear for other players.

You can use this knowledge to manipulate trading GUIs and such.

Hope this helped!

2 comments

0

It's been ten months and now you accepted it bruh

0

lol rip

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