Hi, I wanted to ask if you can activate math.random in a func even if its outside of a script, It might be hard to explain but this is what I am asking about
local random = math.random(1, 5)
local part = script.Parent
part.touched:connect(function()
random = math.random(1,5)
end)
i donot think i understood this well but yes you can use math.random in a function
local function random(m, n)
return math.random(m, n) -- math.random in a function
end
for i=1,10 do
print(random(1,5)) -- will print different number each time
end