local be = game.ReplicatedStorage.MONEY
be.Event:Connect(function(player)
local Currency = player:WaitForChild("leaderstats"):WaitForChild("Currency")
Currency.Value = Currency.Value + 5
end)
*** Just noticed, @GibusWielder posted the exact same changes. So theirs should work also.
game.Player.PlayerAdded:Connect(function(p)
local stats = Instance.new('Folder',p)
stats.Name = 'leaderstats'
local argent = Instance.new('IntValue', stats)
agent.Value = 0
argent.Name = 'Money'
end)
for add money(I do that on a local script):
local player = game.player.LocalPlayer;
local leaderstats = player:WaitForChild('leaderstats')
local Money = leaderstats:WaitForChild('argent')
game.Players.PlayerAdded:Connect(function(player)
-- put here your script
end
-------StartVariable-----
local part = script.Parent
local myfirstray = Ray.new(part.Position, Vector3.new(0, 50, 0))
local zamboniHit = false
local mat = Enum.Material.Ground
local be = game.ReplicatedStorage.MONEY
-------EndVariable-------
while task.wait() or true do
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(myfirstray, {part})
if hit then
if hit.Material == mat then
part.CanCollide = false
part.Transparency = 1
be:Fire(game.Players.LocalPlayer.UserId)
task.wait(5)
part.CanCollide = true
part.Transparency = 0
end
end
end