Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to increase leaderstat?

Asked by 5 years ago

I;m trying to code out a script that increase the leaderstat "headsize" whenever the u key is pressed and this is what I have so far:

01x = 0
02 
03function KeyPress(input, gameProcessed)
04 
05  if input.KeyCode == Enum.KeyCode.U then
06 
07        x = x + 1  
08  end
09end
10 
11game:GetService("UserInputService").InputBegan:Connect(KeyPress)
12 
13 
14game.Players.PlayerAdded:Connect(function(player)
15 
View all 26 lines...

The start works as it starts out with 0, but when I press the U key, nothing happens. I'm sure it's something simple that I'm just blind to, but if you can help me out thanks!

0
is this in one script or two scripts? 123nabilben123 499 — 5y
0
This is in one regular script inside of server script service if that helps Frostmaniz 4 — 5y

Answer this question