When I try to add one to the number value it goes 1-3-6-10-15.

local RepStorage = game:GetService("ReplicatedStorage")
local PlaceStructure = RepStorage:WaitForChild("PlacedStructure")
local Structures = RepStorage:WaitForChild("Structures")

PlaceStructure.OnServerInvoke = function(player, StructureName, StructureCFrame)
    
    if player.FurnitureFolder:FindFirstChild(StructureName) then
        player.FurnitureFolder:FindFirstChild(StructureName).Value = player.FurnitureFolder:FindFirstChild(StructureName).Value + 1
    else
        local itemCheck = Instance.new("NumberValue", player.FurnitureFolder)
        itemCheck.Name = StructureName
        itemCheck.Value = 1
    end
    
    local crafted
    local realStructure = Structures:FindFirstChild(StructureName):Clone()
    
    if realStructure then
        realStructure.CFrame = StructureCFrame
        realStructure.Parent = game.Workspace:FindFirstChild(player.Name.."'s House")    
        
        crafted = true
    else
        crafted = false
    end
    
    return crafted
    
end

4 comments

0

Is this local script or server(normal)?

0

It is probably because you are incrementing/decrementing the value from a local script and incrementing/decrementing from a script

0

is this the full script? i dont think your problem is in this part?

0

use an int value