Script not working as intended

Why isn’t this working? – It runs but nothing happens

local RS = game:GetService("ReplicatedStorage")
local Cooldown = false

RS.Vault.OnServerEvent:Connect(function(Player,VValue,Input)
	if Cooldown == false then
		Cooldown = true
		
		if Player ~= nil then
			if Input == "In" then
			if Player.leaderstats.UltraPlus.Value >= 1 then
					if Player.leaderstats.Vault.Value + VValue <= 1000000 and Player.leaderstats["Time ⏳"].Value - VValue >= 0 then
						if Player ~= nil then
							Player.leaderstats["Time ⏳"].Value = Player.leaderstats["Time ⏳"].Value-VValue
							Player.leaderstats.Vault.Value = Player.leaderstats.Vault.Value+VValue
end
					end
				elseif Player.leaderstats.UltraPlus.Value <= 0 then
					if Player.leaderstats.Vault.Value > 250000 then
						Player.leaderstats["Time ⏳"].Value = Player.leaderstats.Vault.Value-250000
						Player.leaderstats.Vault.Value = 250000
					end
					if Player.leaderstats.Vault.Value + VValue <= 250000 and Player.leaderstats["Time ⏳"].Value - VValue >= 0 then
						if Player ~= nil then
							Player.leaderstats["Time ⏳"].Value = Player.leaderstats["Time ⏳"].Value-VValue
							Player.leaderstats.Vault.Value = Player.leaderstats.Vault.Value+VValue
						end
					end
			end
			
			
			elseif Input == "Out" then
				if Player.leaderstats.Vault.Value - VValue >= 0 then
						if Player ~= nil then
						Player.leaderstats.Vault.Value = Player.leaderstats.Vault.Value-VValue
						Player.leaderstats["Time ⏳"].Value = Player.leaderstats["Time ⏳"].Value+VValue
						end
			end
		end
	end
		Cooldown = false
	end
end)

Could you give a more specific description on what you’re trying to achieve? The ROBLOX default format has a great guide to instruct people on what you’re trying to get to:

--[[
You can write your topic however you want, but you need to answer these questions:
1. What do you want to achieve? Keep it simple and clear!

2. What is the issue? Include screenshots / videos if possible!

3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
]]
1 Like

Not really much more to explain, trying to find out when the function isn’t working?

What is the code meant to do?
What happens when it does?

What are the values of VValue and Input (Examples of what the values would be)

If you place print() statements throughout the code, what parts of the code DO actually run and which don’t.