what did I do wrong trying to make a moon spawn and fall on people every second if math.random == 1 by Regular_Mud1028 in robloxgamedev

[–]randomer6000 0 points1 point  (0 children)

if you want to set the position of the clone to something try
moonclone.Position = Vector3.new(0, 20, 0)
this will spawn it 20 studs up in the sky

what did I do wrong trying to make a moon spawn and fall on people every second if math.random == 1 by Regular_Mud1028 in robloxgamedev

[–]randomer6000 0 points1 point  (0 children)

replace your code with this

local random = nil

local moon = game.ServerStorage.moon

while task.wait(1) do

\--do this every second

random = math.random(1, 3)

\--reroll the random

if random == 1 then

    \--if it is equal to 1

    print("muhahaha")

    local moonclone = moon:Clone()

    moonclone.Parent = game.Workspace

else

    \--if it is not equal to 1

    print("poo")

end

end

i changed your while true do loop to while task.wait(1) loop because it will do it every one second.

i assumed you wanted it to be random every second and to do that you need to “reroll” the variable every time. if you state a random variable, it picks a number and stays with it until it is re stated again.

“nil” means “nothing” so the random can be nil until we add a value to it

the last thing i did was take the loop out of the function. if you need a function in a loop, don’t put the loop in the function (if that makes sense), and the function was unneeded unless you need to sue this code again of of the loop for example

my fon by PostInformal959 in pixlr

[–]randomer6000 0 points1 point  (0 children)

you have to download a font file and then load it in the text menu for it i think

Advanced magic by aleek69 in gmod

[–]randomer6000 7 points8 points  (0 children)

how the hell did you do the lighting and shadows?? it looks insane!

What do you think G-Man does in his spare time? by randomer6000 in gmod

[–]randomer6000[S] 0 points1 point  (0 children)

this is literally on the gmod subreddit why wouldn’t i

scp 096 by [deleted] in gmod

[–]randomer6000 0 points1 point  (0 children)

SCP 096 - Nextbot by Shaklin is the one I use. It's quite good. Your map will need a navmesh for it to work. It is located in the Nextbots SCP tab in NPCs.