#help plz

1 messages · Page 1 of 1 (latest)

ripe linden
#

local HitBox = script.Parent
local rs = game:GetService("ReplicatedStorage")
local MoneyBag = rs:WaitForChild("MoneyBag")

HitBox.Touched:Connect(function(hit)
if not hit:IsA("BasePart") then return end

local touchedModel = hit:FindFirstAncestorOfClass("Model")
if not touchedModel then return end

local valueObj = touchedModel:FindFirstChild("Value")
local canSale = touchedModel:FindFirstChild("CanSale")

if valueObj and canSale and canSale.Value == true then
    if touchedModel:FindFirstChild("AlreadySold") then return end

    local alreadySoldFlag = Instance.new("BoolValue")
    alreadySoldFlag.Name = "AlreadySold"
    alreadySoldFlag.Parent = touchedModel

    print("sale")

    local newBag = MoneyBag:Clone()
    local bagValue = newBag:FindFirstChild("Value")

    if bagValue then
        
        bagValue.Value = valueObj.Value
        
        newBag.CFrame = HitBox.CFrame
        
        newBag.Parent = workspace
        
    else
        
        warn("MoneyBag missing Value object!")
        
    end

    touchedModel:Destroy()
    
end

end)

its just dont work, what is problem

sharp ice
sharp ice
# ripe linden what

i had the same question when i read your question, but apparently there is a problem, who knows what that is tho, not even you i guess? 🤷

#

did you try fixing your problem by figuring out a solution? that usually works for me Thumbs