Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

IntValue not changing for no reason?

Asked by 3 years ago

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!

0
Can you give us the code where you are manipulating that variable? SteamG00B 1633 — 3y
0
Never mind. I solved it via remote events. Though thank you for helping! TheEggsquidzidBoi 38 — 3y

Answer this question