Explained better: I am having fun with math.random() and I wanted it to forcefully add either 7, 6 or 3 points to the score variable.. Here is the script:
local Team1Score = 0
local Team2Score = 0
local conditionalvar= true
--I dont know how to do this so i just thought of the only way that might have worked..
local addon1 = Team1Score + 7
local addon2 = Team2Score + 7
local addon3 = Team1Score + 6
local addon4 = Team2Score + 6
local addon5 = Team1Score + 3
local addon6 = Team2Score + 3
-- I think it will only work in a conditional so i did this
if conditionalvar == true then
local aryAddon = {addon1, addon2, addon3, addon4, addon5, addon6}
randomAddon = aryAddon[math.random(1,#aryAddon)]
return randomAddon -- now I just did this not knowing if it would work or not...
end
--now i dont know how to make it do the variable....
Sorry if it isn't explained well enough! if you have questions just comment below and ill answer.. I'm on a time crunch, but I would really like to know! Thanks for feedback!

1 comment
You should be using Random.new(), its far better then math.random and unbiased.