There are many problems with this script.
I'm not precisely sure what you were trying to do, but I can begin by making this script work.
function Generate(xz, y)
y = game.Workspace.BasePlate.Size = Vector3.new(2,30 or 7,35)
xz = game.Workspace.BasePlate.Size + 212, 21.6, 812 or 234, 21.6, 812
xyz = y + xz
print(xyz)
end
Generate(xyz)
You cannot use or the way you are using it. 30 or 7 is just 30. Probably you are trying to generate a random number between 7 and 30. While we can use math.random directly to do this, it's a bit cumbersome, so let's make our own continuous random number function:
function rand(low,high)
local random = math.random();
random = random * (high - low)
random = random + low
return random
end
Now to generate a random number between 7 and 30, we can write rand(7, 30).
You cannot assign y and Size in one line (that wouldn't even make sense!)
You could possibly just mean to use
game.Workspace.BasePlate.Size = Vector3.new(2, rand(7, 30) ,35)
You don't define xyz as you use it on the final line.
To add Vectors (positions and sizes) you need to add vectors, not the components, e.g.,
part.Size = part.Size + Vector3.new( 1 , 2 , 3)
Please significantly revise your code and describe what it is your are trying to do so we can help you more. I'm really at a loss of what you were trying to accomplish, but hopefully these points help you get in the right direction.
3 comments
Why -1 me?:(
100% Confusing me
Now i get this output:Workspace.Generate:2: attempt to call global 'rand' (a nil value)