#Spawn

1 messages · Page 1 of 1 (latest)

fallow oar
#

Random Spawn

#

I have this script i made that has a 50/50 chance to spawn a noob or a roblox npc. But the script doesn't work.
Can anybody help me?

grand pumice
#

?

#

WHere is that 55

fallow oar
#

?

grand pumice
#

50/50

fallow oar
#

i mean if the number printed is correct then it should spawn a roblox npc or a noob

grand pumice
#

its 1 in 255

fallow oar
#

if the number us correct

#

ik

#

the 50/50 its not what i mean

grand pumice
#

what are you trying to do then

fallow oar
#

spawn an npc with math

grand pumice
#

task.spawn is a budget coroutine

#

it does not spawn anything, it allows "Multithreading"

fallow oar
#

ohh

grand pumice
#

i cant see ur spawn event but thats probably where its lacking

fallow oar
#

so what should i put instead?

grand pumice
#

reference where the original part is, then clone it

cloud pecan
#
local function handleSpawn()
    local randNum = math.random(1, 2)

    if randNum == 1 then
       -- spawn the noob
    elseif randNum == 2 then
       -- spawn roblox npc
    end
end

while task.wait(2) do
   handleSpawn()
end

are you trying to do something like this?

fallow oar
#

wait

#

nope

#

im like forcing a function to do something

cloud pecan
#

wdym force?

grand pumice
#

How do you expect that to work tho

#

you never referenced ur parents

cloud pecan
grand pumice
#

its a 1in 255 chance to spawn, so even if u had the right code youd have to wait a few minutes for it to work

cloud pecan
#

didn't he say he wanted 50/50?

fallow oar
#

i mean 50/50 its not really 50/50

#

its a thing to say

cloud pecan
#

well you need to ask what you need help with properly

grand pumice
#

ur local group = this and that is also weird

#

have never seen that

cloud pecan
#

fr

fallow oar
#

i don't think i will continue this script

#

bc i stopped doing script a few months ago

grand pumice
#

how many hours have you learned to script?

#

i started to learn how to code 4 days ago