Hi, so i want to make a claim part where if you touch it you get 100 money, anyway, i have these two scripts for that and it doesnt seem to work.
script 1:
function leaderboardSetup(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Money"
money.Parent = leaderstats
money.Value = 0
if shared.press == 1 then
money.Value += 100
shared.press = 0
end
end
Players.PlayerAdded:Connect(leaderboardSetup)
script 2:
shared.press = 0
claimPart.Touched:Connect(function(otherPart)
local Humanoid = otherPart.Parent:FindFirstChild("Humanoid")
if Humanoid then
shared.press = 1
end
end)
there are no errors or anything