Ad
Log in to vote
0

This part spawning script just doesnt work?

Asked by 6 days ago
Edited 6 days ago

i am trying to make this part spawn a part when pressed ( with cooldown ), please explain why it doesnt work:

UserInputService = game:GetService("UserInputService")

local rannum = 1

local debounce = true

local cooldown = 0.5

UserInputService.InputBegan:Connect(function(key, typing)

if typing then return end 

local button = Enum.KeyCode.Delete

if key.KeyCode == button then

    if debounce then 

        debounce = false 

        if rannum == 1

        then local poopspawned = 0

        while true do

                if poopspawned >= 1 then

                    wait()

            poopspawned = poopspawned + 1

            local poop = Instance.new("Part", game.Workspace)

            time()

            poop.Color = Color3.new(0,0,0)

            poop.Position = Vector3.new(0,15,0)

        end

        wait(2) 

                debounce = true

            end

        end

    end

end

end)

1 answer

Log in to vote
0
Answered by 4 days ago

how about clone a part in replaced storage it will be easier to make due to the colour, texture and mesh is same what you need to do is adjust the CFrame

0
Oh yeah, didnt think of that. Thanks! fluff_162 2 — 4d
Ad

Answer this question