#whenever i use random, like in any script, it never works or will break my code entirely, any fix?

17 messages · Page 1 of 1 (latest)

severe escarp
#

so i think what might be happening here

timid pasture
#

studio** You are now Level 2! **studio

severe escarp
#

is math.random isnt really compatible with other assets other than a digt

#

like (1,50)

#

unless its probably given variables to communicate or smth

#

i had this problem too once when i tried doing something similar

#

especially since you're trying to find TeleportPart with math.random

haughty sage
#

can you show the whole script?

timid pasture
#

i can assure you it is not the script

#

it is the way i use to make stuff random

#

the game.workspace.pumpkinstuff, exists aswell

#

everytime i use this method of "random" it breaks entirely

haughty sage
#

i dont think the error is coming from these lines though

#

Ah wait

#
local Array = workspace.PumpkinStuff.Spawns:GetChildren()
local TeleportPart =Array[math.random(1, #Array)]
#

you werent indexing the actual table

#

You were just getting a random number from the amount of things inside the spawns