I am making an minigame where players spawn on platforms and random events happen, for a platform growing etc. When i start the game i get the error: Workspace.Script:51: invalid argument #2 to 'random' (interval is empty)
Module script:
local Events = {
}
function Events.LargerPlate() local gamestatus = script.Parent.GameStatus local Platforms = workspace.Platforms:GetChildren() local platform = Platforms[math.random(1,#Platforms)]
gamestatus.Value = "Someones platform grew larger!"
for i = 1,10 do
platform.Size = platform.Size + Vector3.new(0.5,0,0.5)
wait()
end
end
function Events.Unanchored() local gamestatus = script.Parent.GameStatus local Platforms = workspace.Platforms:GetChildren() local platform = Platforms[math.random(1,#Platforms)]
gamestatus.Value = "Someones platform got unanchored!"
wait(1)
platform.Anchored = false
end
Script:
local events = require(script.EventScript) local event = events[math.random(1,#events)]
