#Floor destroying script help

1 messages · Page 1 of 1 (latest)

dawn lark
#

this is my script

azure tusk
# dawn lark

Why do you concat the name of the floor with i?

dawn lark
#

im new so idk a lot

azure tusk
#

no i know why now.. imma look into it hold up

#

can i see your explorer?

dawn lark
#

sure

#

i havent organised it or anything just experimenting with stuff cuz im new to coding

azure tusk
#

So the code seems pretty clean. Try to add task.wait(1) at the start of the code so you make sure every part loads in

feral leafBOT
#

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

dawn lark
azure tusk
#

id say on top of local floors = {}

#

Oh and also you can add a debug print in the for loop that prints each floor so you can see if they are all added to the table

dawn lark
#

tho it still does 1 floor sometimes in the middle

azure tusk
#

hold up im afk 5 mins

#

brb

feral leafBOT
#

studio** You are now Level 1! **studio

dawn lark
#

u meant like this right>

azure tusk
#

yeah

dawn lark
#

i dont really understand why its being inconsistent

#

like sometimes it works as intended

#

such as this pic

dawn lark
#

now its stopped
and in the console it says
"All floors have been removed"

azure tusk
#

weird

#

the code seems fine so idk

#

I found the issue

#

so i remade the script, cleaner

dawn lark
#

oh

azure tusk
#

hold up lemme send it rq

#

and explain it

#

This part is not needed btw since you remove the floor from the table

dawn lark
# azure tusk

why does the script have to be in server script service

azure tusk
#

That is the whole reason ServerScriptService exists. Plus it's cleaner

#

theoretically you can have the script inside workspacke but its not good practice

dawn lark
#

ah ic

#

so its more for organisation sort of

azure tusk
#

Yeah

dawn lark
#

why should variable names not be relative

#

to the script

azure tusk
#

For example you have your script inside workspace and the script might not load in fast enough so if you have a variable relative to the script (script.Parent) it may not work.

#

Not every time but you never know

#

Try to use game.Workspace instead

dawn lark
#

alr hold up im trying to reorganise my thing to how you did it
kinda a decent amoumt to take in (new to coding sry)

azure tusk
#

Don't worry, im not that experienced either xd

dawn lark
#

if your name is just part

azure tusk
#

Nope

feral leafBOT
#

studio** You are now Level 3! **studio

dawn lark
#

for everything floor piece for this

dawn lark
azure tusk
#

So i've quit multiple times. But right now id say maybe 2 weeks or something

#

If you want to learn beginner and advanced scripting i recommend with all my heart BrawlDev's tutorials: https://www.youtube.com/@BrawlDevRBLX

dawn lark
#

haha yeaa i've actually been watching him

#

just finished the beginner tutorial
but i havent really done the final game

#

for beginner tutorial

azure tusk
#

i see

dawn lark
#

tho it hasn't been that long

feral leafBOT
#

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

dawn lark
#

like it took me around 2-3 days to finish beginner

#

so im still tryna get the hang of tables and stuff

azure tusk
#

That is great!

dawn lark
#

its getting much better then when i attempted to learn ts like 3-4 months ago and quit
sort of like learning to reading a book if you get me

azure tusk
#

Yeah exactly

dawn lark
#

what you up to

#

in the advanced

azure tusk
#

Right now i've watched most of Brawdevs videos but what im trying to do is try to think of small games and try to map it out in my head how would everything work. If i get stuck or i dont know what functions or events to use i search it up online and learn that function

dawn lark
#

whats the part = for

azure tusk
# dawn lark whats the part = for

: Part lets roblox know that floors[randomFloor] is going to be a part so if you type like selctedFloor. "something" (event or function) you can fill the text with the pop up suggestion

dawn lark
halcyon sedge
#

so its part

#

same for parameters/arguments

#

etc

dawn lark
azure tusk
#

local funtion(parameter)

end

#

a parameter is a value that you pass in the function

halcyon sedge
#

yes

dawn lark
#

cant you pass pretty much any value in a function

halcyon sedge
#

yes

azure tusk
dawn lark
#

oh thats the maths function stuff he did

#

brawldev

#

is the task.wait() at the bottom meant to be empty

azure tusk
#

It waits one frame of the game

#

but it doesnt interrupt the rest of the code

#

A frame passes by really quick <1s prolly

dawn lark
# azure tusk

in order for the script to work do i need to rename floors to just parts

azure tusk
#

Long story short it prevents the loop from crashing the game

stone crown
#

What is blud doing

azure tusk
dawn lark
#

this error is coming up

azure tusk
#

not sure why that happens

dawn lark
azure tusk
#

nope

dawn lark
#

i may of done smth wrong with my structure

#

cuz the parts arent going orange/red either

azure tusk
#

i see it

#

its floor not floors as the value

#

floors[i] = floor

dawn lark
#

oh fk

#

mbmb

feral leafBOT
#

studio** You are now Level 3! **studio

dawn lark
#

alr now the codes all good and all

#

thoo

#

how do i remove 2 parts at once

#

how do i make it so 2 floors get removed

#

at same time

#

thats kinda the main issue i was having in the first place

#

i couldn't get it to remove 2 floors consistently

#

without bugging out and removing 1

#

or just completely not removing

azure tusk
#

im sending rn

#

hold up i got problem

#

1 sec

#

ok i got it i think

#

lemme test

dawn lark
#

doing smth rq

azure tusk
#

yep

dawn lark
azure tusk
#

for me yeah

#

it should work for you too

#

@dawn lark btw are you trying to make a game or what?

dawn lark
azure tusk
#

Oh i see. good luck!

dawn lark
#

wbu

azure tusk
#

I'm trying to think of a game idea but i cant think of anything

dawn lark
#

so your trying to make a game?