Hello,
I am trying to make a selling system for my simulator game.
However, whenever I step on the ‘sellingpart’ my ‘Clicks’ and ‘Money" change on the clients’ side but not on the server.
local part = game.Workspace.sellingpart
local db = false
part.Touched:Connect(function(hit)
local H = hit.Parent:FindFirstChild(“Humanoid”)
if H then
if not db then
db = true
local player = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
local leaderstats = player.leaderstats
local Clicks = leaderstats.Clicks.Value
local Money = leaderstats.Money.Value
print(Clicks)
Money = Money + Clicks
wait(0.5)
db = false
end
end
end)
Thanks.