#Help, my code won't work

1 messages · Page 1 of 1 (latest)

heavy kayak
#

It spawns 9 things at once not just 1

molten cairn
#

could you like send the whole script and not just 5 lines

heavy kayak
#

okay

heavy kayak
#

this is it

molten cairn
#
local collectionZone = script.Parent
local base = collectionZone.Parent
local auras = script.Parent.Parent:FindFirstChild("AuraStorage")
local auraStands = game.ServerStorage.Assets.AuraStands

local debounce = false

local function collectAura(aura: string)
    if debounce then return end
    debounce = true
    for i, stand in auras:GetChildren() do
        if stand.Value == "" then
            stand.Value = aura
            local displayedAura: Model = auraStands:FindFirstChild(aura):Clone()
            displayedAura.PrimaryPart.Position = stand:FindFirstChild("Stand").Position + Vector3.new(0, 3.5, 0)
            print("worked")
            displayedAura.Parent = stand:FindFirstChild("Stand")
            --for i, v in displayedAura:GetDescendants() do
            --    if v:IsA("Part") then
            --        v.Anchored = true
            --    end
            --end
        end
    end
end

collectionZone.Touched:Connect(function(part: BasePart)
    if part:FindFirstAncestor("Auras") then
        collectAura(part:FindFirstAncestorWhichIsA("Model").Name)
        part:FindFirstAncestorWhichIsA("Model"):Destroy()
    end
end)
heavy kayak
echo current
heavy kayak
#

fr

oblique marlin
#

i believe its because it only happens once and prevents the function from going again while its being used but after that one use it just breaks

heavy kayak
oblique marlin
#

dont set debounce = false at the end

echo current
molten cairn
#

if #auras:GetChildren() > 1 then it will spawn more then 1

#

I think thats the case here

oblique marlin
#

it only will stop it once and never again

echo current
#

idk why its doing ts

heavy kayak
tacit pecanBOT
#

studio** You are now Level 6! **studio

heavy kayak
#

im completly stumped!

echo current
molten cairn
#

thats pretty related in my opinion

echo current
#

the models are being cloned from another folder

#

and placed to where the aura stands are

molten cairn
#
local collectionZone = script.Parent
local base = collectionZone.Parent
local auras = script.Parent.Parent:FindFirstChild("AuraStorage")
local auraStands = game.ServerStorage.Assets.AuraStands

local debounce = false

local function collectAura(aura: string)
    if debounce then return end
    debounce = true
    for i, stand in auras:GetChildren() do
        if stand.Value == "" then
            stand.Value = aura
            local displayedAura: Model = auraStands:FindFirstChild(aura):Clone()
            displayedAura.PrimaryPart.Position = stand:FindFirstChild("Stand").Position + Vector3.new(0, 3.5, 0)
            print("worked")
            displayedAura.Parent = stand:FindFirstChild("Stand")
            --for i, v in displayedAura:GetDescendants() do
            --    if v:IsA("Part") then
            --        v.Anchored = true
            --    end
            --end
        end
        return
    end
end

collectionZone.Touched:Connect(function(part: BasePart)
    if part:FindFirstAncestor("Auras") then
        collectAura(part:FindFirstAncestorWhichIsA("Model").Name)
        part:FindFirstAncestorWhichIsA("Model"):Destroy()
    end
end)

I bet you 1000€ that if you run this its only gonna spawn once

echo current
#

HOW

heavy kayak
#

you can keep your 1000C= because it works, thank you

echo current
#

yeah keep the 1000$ (i cant find the € sign)

golden mason
#

ello ello

native drum
#

if is a true

remote citrus
#

what’s the problem

molten cairn
#

I fixed it

native drum
#

so if debounce then you set debounce to true is the same thing

molten cairn
#

with a return

remote citrus
#

oh

echo current
#

OHHH

#

im so dumb

heavy kayak
#

hes the one that scripted it btw

#

im just watching him do it

#

im not stupid

#

he is

golden mason
heavy kayak
#

LOL

remote citrus
#

Guys chill he’s learning.

heavy kayak
#

Fr

golden mason
#

😎

molten cairn
golden mason
#

i read it and saw the missing return

remote citrus
#

i saw this earlier

#

got too lazy to read the code cuz i’m on my phone and it’s tedious

#

🫩

golden mason
#

literally

molten cairn
molten cairn
remote citrus
#

yeah deadass

#

i find it fun 2 help people but i’m on my phone a lesser majority of my time

#

so it’s annoying to read thru here

golden mason
#

its like reading this


local collectionZone = script.Parent
local base = collectionZone.Parent
local auras = script.Parent.Parent:FindFirstChild("AuraStorage")
local auraStands = game.ServerStorage.Assets.AuraStands

local debounce = false

local function collectAura(aura: string)
    if debounce then return end
    debounce = true
    for i, stand in auras:GetChildren() do
        if stand.Value == "" then
            stand.Value = aura
            local displayedAura: Model = auraStands:FindFirstChild(aura):Clone()
            displayedAura.PrimaryPart.Position = stand:FindFirstChild("Stand").Position + Vector3.new(0, 3.5, 0)
            print("worked")
            displayedAura.Parent = stand:FindFirstChild("Stand")
            --for i, v in displayedAura:GetDescendants() do
            --    if v:IsA("Part") then
            --        v.Anchored = true
            --    end
            --end
        end
    end
end

collectionZone.Touched:Connect(function(part: BasePart)
    if part:FindFirstAncestor("Auras") then
        collectAura(part:FindFirstAncestorWhichIsA("Model").Name)
        part:FindFirstAncestorWhichIsA("Model"):Destroy()
    end
end)
#

which is so painful

molten cairn
#

fr

remote citrus
#

inshallah we all make stupid 100 line cash grabs in the future and make a billion dollars

#

🤤🤤

golden mason
#

💀

#

i reckon

#

if we worked at it

#

we could make the next big brainrot ah game

remote citrus
#

so many brainrot ideas already though

#

feed a brainrot

#

grow a brainrot

#

steal a brainrot

molten cairn
echo current
#

ok new problem 😻

#

it cant run again

remote citrus
#

it’s the future in every industry bro ppl retire bloodlines off of 1 successful game

#

it’s insane

echo current
#

so if u try to get 2 auras

#

the 2nd one just despawns

golden mason
molten cairn
golden mason
#

its crazyyyyy

echo current
molten cairn
remote citrus
#

off of obby on a bike

golden mason
remote citrus
#

yeah ofc

golden mason
#

like 10s of millions

remote citrus
#

biggest game global

molten cairn
#

jandel is just a great business man that has nothing todo with roblox tbf

remote citrus
echo current
#

ohhh

#

ty

remote citrus
#

😭

golden mason
#

valid valid

remote citrus
#

i’ve been tryna find commissions to do that aren’t out of my league and deadass it’s impossible

#

comms payout so much for so little though it’s insane

#

haven’t been able to get one yet

echo current
#

ion haev enough braincells for ts

molten cairn
molten cairn
#

cause of passive income

remote citrus
#

i’ve never dropped any games yet so i wouldn’t know how to handle promo

molten cairn
#

tiktoks

remote citrus
#

not to mention i’ve heard sponsored ads r unreliable asf and u have to blow a shit ton on them

molten cairn
#

playing ur game

#

I think short tiktok playing ur game are the best way to promo

remote citrus
#

yea if u even gain traction on dat tiktok

elder mason
molten cairn
remote citrus
molten cairn
#

and if you go once into the roblox algorythm and your game is actually somewhat playable your gonna stay there for like 1-2 weeks

remote citrus
#

one guy got 100 active for like a week by investing 100 dollars over 5 days

elder mason
#

I mean if you got lucky

#

That zombie tower game just blew up by instant

golden mason
#

which still made a profit for sure

#

but yk

remote citrus
#

from 15k

#

though

golden mason
#

so tbf not that bad