Int value wont change

  1. What do you want to achieve?
    The int value to decrease

  2. What is the issue?
    Int value wont decrease but the function works and everything is labelled right

  3. What solutions have you tried so far?
    Looked at various posts about int values not changing, couldnt find any with this problem

local RE = game.ReplicatedStorage.TankEvents.SmallTankEvent
local tankV = game.ReplicatedStorage.TankEvents.TankValues
local plr = script.Parent.Parent.Parent.Parent

tankV:Clone().Parent = plr


local tankVC = plr:WaitForChild("TankValues")

RE.OnServerEvent:Connect(function(Player)
	tankVC.SmallTank.Value = tankVC.SmallTank.Value - 0.25
	print(tankVC.SmallTank.Value)
end)

notes:
/RE works
/Print the value
/Done in server script
/Server script found in starterGui
image

Int Values cannot handle decimals as it’s a interger. use a number value

2 Likes

^ and you can do -= to shorten your code!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.