#a problem with a shop

66 messages · Page 1 of 1 (latest)

edgy creek
#

i have a shop on the game and it actually works, but i have a script that give you a mount of coins per minute
but the coins that the code give me, dont work on the shop
are like, 2 diferentes coins
srry if i not explain good myself

solemn onyx
#

show me the script that gives coins

#

and is it in localscript or server script

edgy creek
edgy creek
maiden stratusBOT
#

studio** You are now Level 4! **studio

edgy creek
#

its on ServerScriptService

echo igloo
#

Script or LocalScript

edgy creek
echo igloo
#

When you added the script

solemn onyx
#

blue or white

#

next to the name of the script

#

@edgy creek

echo igloo
#

Did you add a "Script" or "LocalScript"

solemn onyx
#

or when you click on the script at the top of the properties tab what does it say

edgy creek
echo igloo
echo igloo
solemn onyx
#
game.Players.PlayerAdded:Connect(function(player)
    local stats = Instance.new("Folder", player)
    stats.Name = "leaderstats"
    local money = Instance.new("IntValue", stats)
    money.Name = "Cash"
    money.Value = 0
    while true do
        task.wait(1)
        money.Value = money.Value + 1
    end
end)
#

just some smal things fixed

#

but idk what could be wrong

edgy creek
#

the script works

solemn onyx
#

yeah but still this is more correct

#

then

edgy creek
#

the thing that im trying its, make it work with my another script about the shop

solemn onyx
#

show me the shop script

edgy creek
#

there are a few scripts related to the shop

solemn onyx
#

then the one where you handle buying the things

edgy creek
#

im searching it

#

but i really dont remember where it was-

#

maybe this one

#

local DataStoreService = game:GetService("DataStoreService")
local MyDataStore = DataStoreService:GetDataStore("MyDataStore")

game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Parent = leaderstats

local data
local success, errormessage = pcall(function()
    data = MyDataStore:GetAsync(player.UserId.."-coins")
end)

if success then
    coins.Value = data
end

end)

game.Players.PlayerRemoving:Connect(function(player)

local success, errormessage = pcall(function()
    MyDataStore:SetAsync(player.UserId.."-coins",player.leaderstats.Coins.Value)
end)

end)

#

but idk, as i say, there are a few scripts related to the shop

solemn onyx
#

this is not the one

#

but i see why there might be a problem

#

cuz you make the leaderstats folder twice

#

first in that other thing and now in this

#

did you make all this?

edgy creek
solemn onyx
#

then who did?

edgy creek
solemn onyx
#

toolbox?

edgy creek
#

no

#

i got it from a video but, im really doing my best for make it work

solemn onyx
#

and the vid works?

#

cuz then you did something wrong and you'll have to double check everything yourself

edgy creek
edgy creek
solemn onyx
#

then check if you missed something

edgy creek
solemn onyx
#

what?

edgy creek
#

srry, im not really good explaining myself
how i do for NOT create a new folder but make the coins of this "CoinsPerSecond script" go to the folder that the "Shop script" has made yet?

edgy creek
solemn onyx
#

just remove the part where it makes the folder

#

just make sure in the entire game it only makes the leaderstats folder once

#

and also the coins intval

edgy creek
#

okok

edgy creek
maiden stratusBOT
#

studio** You are now Level 5! **studio

solemn onyx
edgy creek