Why does it keep saying this

I want to fix this error

“Attempt to index function with new”

code is legit

-- local RNG = Random.new()

What’re you trying to accomplish?

If you’re trying to get a random value, it would be like this.

local RNG = math.random(1,10) -- change the values 1,10 to whatever you want number to be at max etc

Reference: math | Roblox Creator Documentation

randomize a parts position with :SetNumber

Did you name a function Random? If so, it’s overwriting the the Random Class so you need to rename the function

yh i thought of that and was checking it rn, thanks just found it now

1 Like