What do you want to achieve? I’m trying to get a random item from a table. (Please note, as in Virus I mean a Biological Virus)
What is the issue? I can’t find a Random function to do that
What solutions have you tried so far?Use Random.new() and it said it need a number and not a table
Here is the Code:
Script Inside A Model
local sympts = {
}
local viral = require(game.ReplicatedStorage.VirusScript)
local symot1 = viral:GetRandom()
table.insert(sympts, 1, symot1)
ModuleScript Inside Replicated Storage
local virus = {}
function Color()
end
function Scars()
end
function Walk()
end
function Zombie()
end
function Bleed()
end
function Fire()
end
local Symptoms = {
colorChange = Color(),
Scars = Scars(),
Walk = Walk(),
zombiefi = Zombie(),
Bleeding = Bleed(),
Cumbustion = Fire(),
}
function virus:GetRandom()
print("First Sympt")
local FirstSympt = Random.new(Symptoms) --This is where it is erroring out
print(FirstSympt)
return FirstSympt
end
return virus