Im trying to make a GUI Shop in Roblox but the value only prints 0. Here's the code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent1 = ReplicatedStorage:WaitForChild("RemoteEvent1")
local DataStore2 = require(1936396537)

local function Buy(player)
	local Price = script.Parent.Parent.StarterGui.ShopGUI.ShopFrame.ItemInfo.Int --The variable that won't change.
	local Coins = game.Players[player.Name].Coins
	print(Price.Value)
	if Price.Value <= Coins.Value then
		local CoinsStore = DataStore2("Coins", player)
		CoinsStore:Increment(-Price.Value)
	end
end

remoteEvent1.OnServerEvent:Connect(Buy)

Any help will be appreciated very much!

2 comments

0

Can you give us the code where you are manipulating that variable?

0

Never mind. I solved it via remote events. Though thank you for helping!