HELP please please its giving me Sips but it wont count on leaderstats when I go to sale I don't get anything!!!!!!!!
Clicking Script-
local player = game.Players.LocalPlayer
local CanUse = true
script.parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
if not (CanUse) then return end
player.leaderstats.Sips.Value = player.leaderstats.Sips.Value + 1
CanUse = false
wait(1)
CanUse = true
end)
end)
Leaderstats-
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
stats.Parent = p
local money = Instance.new("IntValue")
money.Name = "Sips" -- Change "Money" to anything you want to name it like "Cash"
money.Value = 0 -- Change the value to how many you want when the player joins the game
money.Parent = stats
local Cash = Instance.new("IntValue")
Cash.Name = "Cash" -- Change "Whatever" to anything you want to name it like "Cash"
Cash.Value = 0 -- Change the value to how many you want when the player joins the game
Cash.Parent = stats
end)
Sell Part-
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 Currency = leaderstats.Cash -- Change Money To your currency
local Selling = leaderstats.Sips -- Change Grass to what you selling.
if Selling.Value > 0 then
Currency.Value = Currency.Value + Selling.Value *1 -- This 1 means multiple you can change it to whatever you want
Selling.Value = 0
end
end
end
end)

2 comments
Please someone help please! The script that goes into the tool Must stay in that tool everything works I get cash I its just it dose not sale? its like it dosent really go onto the leaderstats
Check if you aren't doing this in a localscript