Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

?I am trying to make a tycoon clone But the if statement is ignored.

Asked by 6 years ago
Edited 6 years ago

When i make the dropper clone it keeps cloning in the same place.

And it makes ALOT of droppers and the if statement is completely ignored. I am looking for help with that issue and i don't know why the statement is ignored

script.Parent.Touched:Connect(function(hit)
        if hit.Parent:findFirstChild("Humanoid") then
            local price = script.Parent.Parent.Script.price
            local itemname = script.Parent.Parent.Script.itemname
            local playername = hit.Parent.Name
            local currencyName = script.Parent.CurrencyName
            local tt = 0.1
            local player = game.Players:FindFirstChild(playername)
            local disabled = false


            print(playername)
            local function Negate()

                local dropper = game.ServerStorage:FindFirstChild(script.item_name.Value)

                if disabled == false then
                    script.Parent.Transparency = 1
                    script.Parent.Parent.Part.Transparency = 1
                    script.Parent.Parent.BillboardGui.TextBox.Visible = false
                    local debounce = false
                    if  disabled == false and dropper and debounce == false then
                        local d = dropper:Clone()
                        d.Parent = workspace
                        disabled = true
                        debounce = true
                    end

                    disabled = true
                    print(disabled)

                end
            end
            Negate()

        end
end)
0
Lighting should NOT be used as storage, and clone is deprecated use Clone User#19524 175 — 6y
0
Is "item_name" an ObjectValue? Naxxanar 77 — 6y
0
@Naxxanar No it is not FallenReju 3 — 6y
0
Could you tell me what it is? Naxxanar 77 — 6y
View all comments (3 more)
0
Actually, my bad. That doesn't seem to be the problem. We need more of your code to resolve your issue. Naxxanar 77 — 6y
0
I have published all the code but for some reason the top isnt formatted FallenReju 3 — 6y
0
Put the ENTIRE script in between the ~~~~~ and ~~~~~. I think with the entire script some of us could help you. Pojoto 329 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I managed to make a temporary workaround by putting the actual button in serverstorage but i don't really recommend people to do it.

Ad

Answer this question