i making a simulator and my script to sell stuff and earn cash wont work?
Asked by
3 years ago Edited 3 years ago
local part = script.Parent
part.Touched:Connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local leaderstats = player:WaitForChild("leaderstats")
local money = leaderstats.Gold
local selling = leaderstats.Sips
if selling.Value >= 0 then
money.Value = money.Value + selling.Value*1
selling.Value = 0
end
end
end
end)