Hello
I am trying to make stuff spawn in throughout the map but everytime I try this error shows up:
I am trying to use math.random with Positions, here is some of the script:
local PositionX = math.random(-523.2, 17.9)
local PositionZ = math.random(-437.5, 388)
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local event = math.random(1,30)
local timer = math.random(30,90)
if event == 1 then
local Police = game.ServerStorage.Events.Police:Clone()
Police.Position = math.random(PositionX, 4.5, PositionZ)
Police.Parent = workspace
elseif event == 2 then
local Marine = game.ServerStorage.Events.Marine:Clone()
local position = Vector3.new(math.random(PositionX),3,math.random(PositionZ))
local cf = CFrame.new(position)
Marine:PivotTo(cf)
Marine.Parent = workspace
elseif event == 3 then
local Zombie = game.ServerStorage.Events.Zombie:Clone()
local position = Vector3.new(math.random(PositionX),2.691,math.random(PositionZ))
local cf = CFrame.new(position)
Zombie:PivotTo(cf)
Zombie.Parent = workspace
I looked up for some examples on how to use the Position but the the error popped up whenever I triggered the prompt
What do I do?