You can write your topic however you want, but you need to answer these questions:
- I can’t get this coin system to work
–Coin Stuff
local DataStore = game:GetService(“DataStoreService”)
local ps = DataStore:GetDataStore(“WinStoreSystem”)
local cs = DataStore:GetDataStore(“CoinsStoreSystem”)
game.Players.PlayerAdded:Connect(function(player)
local q = Instance.new(“IntValue”)
q.Name = “Queue”
q.Parent = player
script.Stats:Clone().Parent = player
local l = Instance.new(“BoolValue”)
l.Name = “leaderstats”
local ex = Instance.new(“IntValue”)
ex.Name = “Wins”
ex.Value = ps:GetAsync(player.UserId) or 0
ex.Parent = l
ps:SetAsync(player.UserId, ex.Value)
ex.Changed:Connect(function()
ps:SetAsync(player.UserId, ex.Value)
local function onPlayerJoin(player)
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “leaderstats”
leaderstats.Parent = player
end
local coins = Instance.new(“IntValue”)
coins.Name = “Coins”
ex.Value = cs:GetAsync(player.UserId) or 0
ex.Parent = 1
coins.Value = 15
coins.Parent = leaderstats
cs:SetAsync(player.UserId, ex.Value)
ex.Changed:Connect(function()
cs:SetAsync(player.UserId, ex.Value)
l.Parent = player
end)
game.Players.PlayerAdded:Connect(onPlayerJoin)
It keeps saying expected end to close function at line 18 got but i’m stupid and can’t figure it out
I tried changing ends and doing other stuff but i’m stuck