I got an error and it seems like my way of randomising the item location is wrong.Can anybody tell me what is wrong with it?It will be a really good help.The error says:"Workspace.Part.Script:6:wrong number or arguments."The part is in Workspace,the part being with a script inside it.Also i ran the test in run mode in Roblox Studio and the print doesnt seem to work either,if you dont know what line to look at you should look at line 6.Sorry that the script looks bad in the website.I'm new to it.
local brick = script.Parent
brick.CanCollide = false brick.Parent = game.Workspace
local key = math.random(1,2,3,4) if key == 1 then brick.Position = Vector3.new(-116.75,18.859,387.5) print("first") elseif key == 2 then brick.Position = Vector3.new(-156.75,18.859,389.5) print("second") elseif key == 3 then brick.Position = Vector3.new(-135.25,18.859,368.5) print("third") elseif key == 4 then brick.Position = Vector3.new(-135.75, 18.859, 387.5) print("fourth") end

1 comment
Please use code blocks