#setting multiple property values to previous properties (solved)

1 messages · Page 1 of 1 (latest)

tight temple
#

I'm not understanding the issue here. Just iterate through all the parts and make their castshadow align with the setting.

rotund wagon
#

You have have in the the part, a custom property that says if it should be on or off, for parts you want always off, set it to off...then in the script read that property and if it is set to off, do not turn it on..

#

you would prob need all parts to have that property , and or some error handling to handle if it reads a parts and fails because that property is not set...

#

if you can do that error checking so the script not fail, then you could just have the parts that you want to toggle have the property...

#

another way would be to name the parts all the same like 'Toggle' , read the part name , and if toggle the toggle

#

I think that is what you mean..

#

you do not want to turn it on for all parts in the workspace..

#

another way would be to have a folder named Toggle, and only toggle parts that are in that folder

tight temple
#

Oh I get what you're saying

#

If it's never supposed to have CastShadow toggled at all

#

So yeah, I would deliberately treat anything that needs CastShadow set to false as separate from the process altogether

#

So like LordBrady said, you could indicate specifically which parts are toggleable, or to be more broad, indicate specifically which ones are not toggleable and just iterate through all part descendants

frail harbor
#

Create a table to remember which part CastShadows was disabled

loud nova
#

yeah I was thinking of doing a table

loud nova
#

I don't have the patience for that

#

it's also something I could easily miss when expanding maps

#

I plan on doing it with tables/arrays but I'm not 100% sure how

tight temple
#

lol

loud nova
#

any ideas??

#
while task.wait(5) do
    
    local Descendants = {}
    Descendants = workspace.Folder:GetChildren()
    
    for _,Descendant in ipairs(Descendants) do
            
        local Properties = {
                
            ["CastShadow"] = ""
                
        }
            
        table.insert(Properties,Descendant.CastShadow)
        Descendant.CastShadow = false
            
        task.wait(1)
            
        for Index,Value in pairs(Properties) do
            
            Descendant[Index] = Value
            print(Descendant,Index,Value)

        end
    end
end
#

this is what i have

#

somehow the print(Descendant,Index,Value) is printing this

#

15:18:38.058 ON 1 true - Client - GABBER:22
15:18:38.060 ON CastShadow - Client - GABBER:22

#

this is my part hierarchy

#

off are parts with castshadow off

#

on are parts with castshadow on

tight temple
#

No matter your implementation, going through literally every part to do that is going to be tedious

#

So if you want it done you might as well get it done and operate on the assumption you'll need to do it as part of your workflow instead of doing it every time you make a huge bump in map dev

loud nova
#

im not going through every part though manually?

#

im doing it with code

tight temple
#

Yeah. I can read

#

I'm just saying 'tagging' and 'setting every part to off' are indistinguishable

#

with a tag

#

it makes no difference, you still have to heuristically differentiate between massive groups of parts

loud nova
#

are you talking about tagging every single part with castshadow off using code before runtime?

tight temple
#

Tagging all the parts, and setting part names to "OFF" or "ON" are not any different. You can achieve the implementation with either. What you are doing will work. I was just making the point that it's literally no different regardless of which you use bro lol

#

You'll have to do it before runtime anyway cuz Idk how you would in-code determine which you need to toggle and which you don't

#

cuz it's a design intention

loud nova
#

the parts called "ON" and "OFF" were me just testing

#

there isnt going to be a folder for parts that shouldnt have castshadow on

#

im going to be using game:getdescendants()

tight temple
#

Right. So what is wrong w using tags or attributes

#

How else do you intend to determine which shouldn't be toggleable

loud nova
#

inserting parts with castshadow off into a table/array

tight temple
#

so you're still using an attribute then

#

good job 😎

loud nova
#

are you in a bad mood or what

tight temple
#

Yea my bad I just got frustrated homie

#

I've been having throat bleeding and it's pissing me off

loud nova
#

damn

#

sounds fucking horrible i must say

#

are you like coughing up blood and stuff?

tight temple
#

Not a lot at once but it has happened like 3 times now

#

It's not runny blood either so I'm not sure where it's coming from, my throat or my airway or my lungs

#

Idek I wanna get it checked but I don't want the dumb ass hospital to overwhelm me with bills again cuz I don't have insurance 😭

loud nova
#

do you smoke by any chance?

tight temple
#

just weed

#

I cut back for the past week and a half almost 2 cuz I was having shortness of breath but that symptom went away when I had stopped for about 4 days

#

I've only been doing it right before I go to my restaurant job cuz it sucks doing that shit sober lol

#

I may have no choice but to stop completely

loud nova
#

i would get it checked out but i understand the bill problem

#

i guess you just have to wait it out and hope for the best

tight temple
#

Found some zpac antibiotics I didn't use, going to obliterate this problem 😎

loud nova
#

nice

#

i found a solution by the way

#

it was much easier than what i was suggesting

tight temple
#

What is it?

loud nova
#

i just made two tables, one for parts without castshadow on

#

and the other for ones with castshadow on

#

when changing the settings, i only changed the castshadow property of the ones that had castshadow on by default

#

setting multiple property values to previous properties (solved)

#

by the way, should i be closing my posts after they're solved? or should i leave them just in case other people have similar problems

tight temple
#

Usually but Suphi does close it eventually when we forget