Checking price for items in ServerStorage

im making s shop but i dont know how to check the item price i put a intValue in the item which located in server storage
so how do check the price value of the item from serverstorage

1 Like

ServerStorage can’t be accessed via local script. I’m assuming you’re using a local script since your shop is most likely a gui.

2 Likes

just like @rokec123 said, you have to use Remotes to access ServerStorage, and you just have to compare the values, for example

local value1 = script.Parent
local value2 = script.Parent.Parent

if value1.Value >= value2.Value then
   value1.Value = value1.Value - value2.Value
end

that’s just an example, but you could do something similar to that

1 Like

Use Remote Functions to do that

Here’s a tutorial:

3 Likes

You are kinda vague tbh. Can you elaborate more? There are multiple different ways to check the price of something in server-storage.

I mean… if you wanted to do check the price of an object in server storage using a script, then here you go:

local item = game.ServerStorage.Item
local cost = item.Cost.Value

if playersMoney >= cost then
    -- The player has enough money to buy it
else
    -- The player does not have enough money to buy it
end
2 Likes

but… if the value of the cost is higher than what the player’s got, how can the player have enough money to buy it?? doesn’t make any sense, I mean… it does check if it’s equal to the money that player has but shouldn’t it be the other way around?

1 Like

My mistake. I fixed it.

30 cha

1 Like