for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Lava" or v.Name == "TeleportPad" then
v.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player ~= nil then
local number = math.random(1, 5)
if number == 1 then
ad = script.RunAd:Clone()
ad.Parent = player.PlayerGui
ad.Disabled = false
end
end
end)
end
end
I want this to get just 1 random number, between numbers 1 - 5, but it gives out lik 10 numbers, for example
2, 5, 3, 3, 3, 2, 4, 1, 2, 5
How can I get it so it just gives 1 random number?

2 comments
Your question doesn't make sense. Include the full context of how you're using this number.
I edited it with the full script.