The issue is whenever I trade the currency it changes but when i go to collect like a gem it goes back to the original currency!
What solutions have you tried so far?
Finding a solution!
local Player = game.Players.LocalPlayer
local Lightning = game.Lighting
local Blur = Lightning.Blur
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
if script.Parent.Parent.COSMETIC.TextLabel.Text == "Yes" then
script.Parent.Parent.Parent.ButtonN.Visible = false
game.Players.LocalPlayer.leaderstats.Gems.Value = game.Players.LocalPlayer.leaderstats.Gems.Value + script.Parent.Parent.Parent.Parent.TradingGems.Value
game.Players.LocalPlayer.leaderstats.Coins.Value = game.Players.LocalPlayer.leaderstats.Coins.Value - script.Parent.Parent.Parent.Parent.TradingCoins.Value
if script.Parent.Parent.Parent.Parent.Talk.Value < 5 then
script.Parent.Parent.Parent.Parent.Talk.Value=script.Parent.Parent.Parent.Parent.Talk.Value + 1
end
else
if script.Parent.Parent.Parent.Parent.Talk.Value < 5 then
script.Parent.Parent.Parent.Parent.Talk.Value = script.Parent.Parent.Parent.Parent.Talk.Value + 1
end
end
end)
local Lightning = game.Lighting
local Blur = Lightning.Blur
script.Parent.MouseButton1Click:Connect(function(Players)
script.Parent.Parent.Visible = false
if script.Parent.Parent.COSMETIC.TextLabel.Text == "Yes" then
script.Parent.Parent.Parent.ButtonN.Visible = false
Players.leaderstats.Gems.Value = Players.leaderstats.Gems.Value + script.Parent.Parent.Parent.Parent.TradingGems.Value
Players.leaderstats.Coins.Value = Players.leaderstats.Coins.Value - script.Parent.Parent.Parent.Parent.TradingCoins.Value
if script.Parent.Parent.Parent.Parent.Talk.Value < 5 then
script.Parent.Parent.Parent.Parent.Talk.Value = script.Parent.Parent.Parent.Parent.Talk.Value + 1
end
else
if script.Parent.Parent.Parent.Parent.Talk.Value < 5 then
script.Parent.Parent.Parent.Parent.Talk.Value = script.Parent.Parent.Parent.Parent.Talk.Value + 1
end
end
end)
local Player = script:FindFirstAncestorWhichIsA("Player")
local LS = Player:WaitForChild("leaderstats")
local Gems = LS:WaitForChild("Gems")
local Coins = LS:WaitForChild("Coins")
local Lightning = game:GetService("Lighting")
local Blur = Lightning:WaitForChild("Blur")
local CurrencyGui = script:FindFirstAncestorWhichIsA("ScreenGui")
local Talk = CurrencyGui:WaitForChild("Talk")
local TGems = CurrencyGui:WaitForChild("TradingGems")
local TCoins = CurrencyGui:WaitForChild("TradingCoins")
local Dialogue = CurrencyGui:WaitForChild("Dialogue")
local ButtonN = Dialogue:WaitForChild("ButtonN")
local Button = script.Parent
local ButtonY = Button.Parent
local Cosmetic = ButtonY:WaitForChild("COSMETIC")
local Label = Cosmetic:WaitForChild("TextLabel")
Button.MouseButton1Click:Connect(function()
ButtonY.Visible = false
if Label.Text == "Yes" then
ButtonN.Visible = false
Gems.Value += TGems.Value
Coins.Value -= TCoins.Value
if Talk.Value < 5 then
Talk.Value += 1
end
else
if Talk.Value < 5 then
Talk.Value += 1
end
end
end)