Struggling to find bug in my script from my clicker game?
So I have been making this game and I'm trying to add an upgrading system. But the script that meant to be the automated stuff your making isn't working with the rework. The goal here is to combine the number of buildings you have by the multiplier from the upgrade. There is no error in the console. This script is a server script which is located in ServerScriptService. The hi's do print but the Chocolate leaderstat does not rise. Script:
01 | local NOMC = game.Workspace.MCbutton.Top.Script.NOMC |
02 | local NOB = game.Workspace.Bbutton.Top.Script.NOB |
03 | local NOC = game.Workspace.Cbutton.Top.Script.NOC |
04 | local MCmulti = NOMC.Parent.MCmulti |
05 | local Bmulti = NOB.Parent.Bmulti |
06 | local Cmulti = NOC.Parent.Cmulti |
07 | local MC = NOMC.Value * 1 * MCmulti.Value |
08 | local B = NOB.Value * 5 * Bmulti.Value |
09 | local C = NOC.Value * 25 * Cmulti.Value |
11 | game.Players.PlayerAdded:Connect( function (player) |
13 | player:WaitForChild( "leaderstats" ).CPS.Value = MC + B + C |
14 | if player.leaderstats.CPS.Value > = 20 then |
16 | player.leaderstats.Chocolate.Value + = player.leaderstats.CPS.Value / 20 |
21 | player.leaderstats.Chocolate.Value + = player.leaderstats.CPS.Value |