local pathpart = workspace.IslandParts.islandpaths.islandpath
for i,pathpart in pairs(pathpart.Parent:GetChildren()) do
if pathpart.Name == "islandpath" then
local palmgen= math.random(30)
if palmgen == 2 then
print("PALM GEN IS: ",palmgen)
local palm = game.ReplicatedStorage.Assets.islandnature.palm:Clone()
palm.Parent = workspace
palm:MoveTo(pathpart.Position)
else
print("PLAM GEN IS: ",palmgen)
end
end
end
Facilities should create a random object if palmgen = 2, but math.random ALWAYS produces the same random numbers. How to make this feature really random?

1 comment
math.random uses a seed to calculate its 'random' output. In studio, the seed doesn't update when you test it again and again. It will be different in an actual game, though.