Can someone tell me how to make an exchange leaderstats gui because I need it for my Halloween game. Ill tell an example.
Someone has 5 candy then they click a button and they lose 5 candy and get 10 money.
Can someone tell me how to make an exchange leaderstats gui because I need it for my Halloween game. Ill tell an example.
Someone has 5 candy then they click a button and they lose 5 candy and get 10 money.
This is just a simple matter of manipulating instance values and designing the GUI. First design the GUI, open button, close button, the frame, button to click on, labels, all of that. Use a LocalScript in the button, then a RemoteEvent to send a signal to a server script in ServerScriptService that will detect the event and make the change. Here are some code examples
Local Script
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Events.EventName:FireServer()
end)
Server script
game.ReplicatedStorage.Events.EventName.OnServerEvent:Connect(function(plr)
--Make the exchange here
end)
Hope this helps
What you would do is when a player clicks a button, you would fire a remote event when the button is clicked, and recieve that remote event on a server script, then perhaps saying something like :
if player.leaderstats.candy.Value >= 5 then
player.leaderstats.candy.Value = player.leaderstats.candy.Value - 5
player.leaderstats.money.Value = player.leaderstats.money.Value + 10
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Idk how to make the exchange though because I asked how to make the button exchange not how to make it filtering enabled comptatible