I am trying to call the functions randomly. But I do not know where to start. Any tips on how to begin? I have tried using math.random but no success.
local paper = game.ReplicatedStorage.Spawnables.Paper
local folder = game.ReplicatedStorage.Spawnables
-- paper spawnings
function paperSpawn()
local spawnPaper = paper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function voidSpawn()
local spawnPaper = folder.VoidPaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function redPaper()
local spawnPaper = folder.RedPaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function LightPaper()
local spawnPaper = folder.LightPaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function GoldPaper()
local spawnPaper = folder.GoldPaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function DiamondPaper()
local spawnPaper = folder.DiamondPaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function EmeraldPaper()
local spawnPaper = folder.EmeraldPaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
function PurplePaper()
local spawnPaper = folder.PurplePaper:Clone()
spawnPaper.Parent = workspace
local xpos = math.random(-100, 100)
local ypos = 0.5
local zpos = math.random(-100, 100)
spawnPaper.Position = Vector3.new(xpos, ypos, zpos)
end
-- randomizer
