I am trying to make my dropper script make my “level” stat go up a specific number, not ADDING I need it to change to a specific number. Everything else in the script is working correctly I just need help on this one thing.
wait(1.1)
local module = require(script.Parent.Parent.Parent.Parent.Parent.Settings)
local dropInfo = script.Parent.DropperInfo
local tcnInfo = script.Parent.Parent.Parent.TycoonInfo
local drop = script.Parent.Drop2
local mesh = script.Parent:FindFirstChild("CustomDrop2")
if mesh then mesh.Parent = nil end
while true do
local part
if mesh then
part = mesh:Clone()
part.Parent = workspace.Parts
part.Transparency = 0
part.Anchored = false
part.CanCollide = true
else
part = Instance.new("Part", workspace.Parts)
part.Material = tcnInfo.DropMaterial.Value
part.BrickColor = BrickColor.new("Institutional white")
end
--make size 1,1,1
part.Size = Vector3.new(0.6, 0.6, 0.6)
part.CFrame = drop.CFrame
local value = Instance.new('IntValue', part)
value.Value = dropInfo.LevelValue.Value
value.Name = 'Level'
game.Debris:AddItem(part, module.dropLifeTime)
wait(dropInfo.LevelTimer.Value)
end