So because nobody has answered my previous question yet I am writing a new one where I have come up with a new idea that should in theory work but isn't. here is the code
local part = script.Parent
local function createblock()
local block = Instance.new("Part", game.Workspace)
local xvalue = math.random(-56.505, -99.505)
local yvalue = 35
local zvalue = math.random(104.5, 159.5)
block.Position = Vector3.new(xvalue, yvalue, zvalue)
end
while true do
createblock()
wait(.2)
end
I seems fine what it does is I have set a range with a math.random sequence so it will get a random position in a certain range. When I run it is has an error message on line 5 with the x value saying like interval is empty. I tried multiple times it didn't work. I then tooked the -99.505 and changed it to a positive number to see what would happen it worked fine just not in the range I wanted it to. Can I not have a negative then a negative number in a math.random function?

1 comment
ahhh thank you