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 4 years ago

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

01local ReplicatedStorage = game:GetService("ReplicatedStorage")
02local remoteEvent1 = ReplicatedStorage:WaitForChild("RemoteEvent1")
03local DataStore2 = require(1936396537)
04 
05local function Buy(player)
06    local Price = script.Parent.Parent.StarterGui.ShopGUI.ShopFrame.ItemInfo.Int --The variable that won't change.
07    local Coins = game.Players[player.Name].Coins
08    print(Price.Value)
09    if Price.Value <= Coins.Value then
10        local CoinsStore = DataStore2("Coins", player)
11        CoinsStore:Increment(-Price.Value)
12    end
13end
14 
15remoteEvent1.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 — 4y
0
Never mind. I solved it via remote events. Though thank you for helping! TheEggsquidzidBoi 38 — 4y

Answer this question