#How do you make a part give a currency?

17 messages · Page 1 of 1 (latest)

mystic tree
#

Part.Touched

cosmic chasm
#

show code

#

then no help heehehuua

scarlet mauve
#

whats wrong with people here...

cosmic chasm
#

show code?

scarlet mauve
#

what da....

script.Parent.Touched:Connect(function(part)
    local plr = game.Players:GetPlayerFromCharacter(part.Parent)
    if plr then
        plr.leaderstasts.Monney.Value += 10
    end
end)
#
game.Players.PlayerAdded:Connect(function(plr)
    local le = Instance.new("Folder",plr)
    le.Name = "leaderstats"
    
    local le = Instance.new("NumberValue",le)
    le.Name = "Monney"
end)
#

he just asked to increse the monney wen tuching a part
not how to make saving leaderstats spamming the output

cosmic chasm
#

Probably because .Hearbeat thats why the speed is adding up so fast

#

Yeah

#

Maybe replace it with wins.Changed?

scarlet mauve
#
while task.wait(1) do
   plr.leaderstasts.Monney.Value += 1
end
#

the whole script would look like this

game.Players.PlayerAdded:Connect(function(plr)

    local le = Instance.new("Folder",plr)      --Create leaderstats
    le.Name = "leaderstats"
    
    local Monney = Instance.new("NumberValue",le)  --create Currency
    Monney.Name = "Monney"

  while task.wait(1) do                  --every second 
     Monney.Value += 1                   --increase currency by 1
  end
end)
#

it increases the Monney every second by 1

cosmic chasm
#

the guy said it was supposed to be 1+ speed per win though?

scarlet mauve
#

just do

win +=1
speed += 1

misty bloom
#

Huh??