So im trying to make a script that when I click a textbutton it spawns a part but add a 1% chance to spawn a red part.I also need help trying to find out how to spawn that part at a certain position.This is my current script:
myPart = Instance.new("Part",game.Workspace) script.parent.MouseButton1Click:Connect(function() Instance.new("Part",game.Workspace) end)
Not sure if this works, didn't test. Let me know.
myPart = Instance.new("Part",game.Workspace) script.parent.MouseButton1Click:Connect(function() local rand = math.random(1,100) if rand == 1 then Instance.new("Part",game.Workspace) else -- didn't get it end end)