Believe there is an issue in the increment somewhere, I need to increase player cash and wins, on that part’s touch.
Script:
local ds = require(1936396537)
local rs = game:GetService("ReplicatedStorage")
local dvc = 0
local dvw = 0
game.Players.PlayerAdded:Connect(function(plr)
local cashStore = ds("points",plr)
local winStore = ds("wins",plr)
local leaderstats = Instance.new("Folder",plr)
leaderstats.Name = "leaderstats"
local coins = Instance.new("IntValue",leaderstats)
coins.Name = "Coins"
local wins = Instance.new("IntValue",leaderstats)
wins.Name = "Wins"
local function UpdateCash(upVal)
coins.Value = cashStore:Get(upVal)
end
local function UpdateWins(upVal1)
wins.Value = winStore:Get(upVal1)
end
UpdateCash(dvc)
UpdateWins(dvw)
cashStore:OnUpdate(UpdateCash)
winStore:OnUpdate(UpdateWins)
end)
game.Workspace:WaitForChild("YouWonPart").Touched:Connect(function(hit, player)
if hit.Parent:FindFirstChild("Humanoid") then
local cashStore = ds("points",player)
local winStore = ds("wins",player)
cashStore:Increment(100,dvc)
winStore:Increment(1,dvw)
end
end)```