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

Why Won't This Work Help Anyone?

Asked by 10 years ago

I Wanted To Make A Part Spawner That Can Spawn More Than 2 Things With A Chance Rate I Tried To Make One But, It won't work any answers?

function kok()
    local p = Instance.new("Part")
    p.Position = script.Parent.Position
    p.Name = "Rock"
    p.Parent = script.Parent
function lol()
    local s = Instance.new("Part")
    s.Position = script.Parent.Position
    s.Name = "Stuff"
    s.Parent = script.Parent
    end
end
while true do
f = math.random(1,2)
if f == 1 then
kok()
elseif f == 2 then
lol()
wait(1.5)
end
end
0
It would help if you said what it displayed in the Output ImmenseKassing 120 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
function kok()
    local p = Instance.new("Part")
    p.CFrame = CFrame.new(0,0,0) -- Add Position
    p.Name = "Rock"
    p.Parent = script.Parent
print("1")
end
function lol()
    local s = Instance.new("Part")
    s.CFrame = CFrame.new(0,0,0) -- Add Position
    s.Name = "Stuff"
    s.Parent = script.Parent
print("2")
 end
while true do
f = math.random(1,2)
if f == 1 then
kok()
elseif f == 2 then
lol()
end
wait(1.5)
end

0
remove 6th and 13th lines erikask123 15 — 10y
Ad

Answer this question