#beginner needs help with scripting gui !!

1 messages · Page 1 of 1 (latest)

thick furnace
#

so i have been trying for literal hours to make the most Basic mechanic (this is my first time ever trying to script) and i can't figure out how to make the GUI image textures disappear depending on how many charges the player has !!

#

ok let me grab the scripts

#

the player has is given 3 charges of their ability at the start in this code

#

this is what's inside of StarterGUI and handles the white fill parts of the three star shaped charges on the screen

#

only problem is idk how to actually make the visiblity false

#

the original starburst script does have the attribrute

flat perch
#

use part.AttributeChanged to detect when the charge amount is increased or decreased

#

its pretty simple once u got it lmao

thick furnace
#

brain

#

is Melted

#

i dont know where to even put that

#

or what "part" is supposed to be

flat perch
#

part is whatever the attribute is on

thick furnace
#

so the "starburst" script

brazen mountainBOT
#

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

flat perch
#

and u would want to place the detection in the gui script

thick furnace
#

in the function or what

#

waitt

#

no im still lost

flat perch
#

outside of the function just do

part.AttributeChanged:Connect(setChargeAmountGUI)
thick furnace
#

i literally don't know what im doing

brazen mountainBOT
#

studio** You are now Level 12! **studio

flat perch
thick furnace
#

the part is a script though

flat perch
#

it was taken from an example using a part

thick furnace
#

well this isn't working

flat perch
#

but it just requires an instance

thick furnace
#

wait

flat perch
thick furnace
#

its startercharacterscripts

#

not starterplayer whoops

#

ok it looks like this

#

i get no errors but the gui doesnt change

flat perch
#

look for the scripts in player.Character

thick furnace
#

the original attribute does change because when i tell it to print it prints the new attribute value

flat perch
#

any scripts that are in StarterCharacterScripts will need to be found on the actual character when u start ur game

#

same goes for starterplayerscripts

thick furnace
#

yeah?

#

well they're there

#

There aren’t any scripts in starterplayerscripts

#

I don’t even know what that’s for

flat perch
#

change ur "starburst" variable to be player.Character.Starburst.Starburst

thick furnace
#

Woah that did something

brazen mountainBOT
#

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

thick furnace
#

i have the starburst gui to have only two of the white parts filled

#

now when i press Shift in game it fills to 3

#

but it wont go back down to 2 or 1

#

even though pressing shift once sets the attribute to 2

#

so if i set them all invisible, they become visible once the attribute changes

flat perch
#

it looks like in ur Starburst script ur only decreasing the charges

thick furnace
#

every press of shift uses one charge

flat perch
#

ahh

thick furnace
#

but this is not reflected in the gui for some reason

flat perch
#

so put local chargeamount = starburst:GetAttribute("chargeamount") inside of the "setChargeAmountGUI" function

#

at the top

thick furnace
#

that does nothing

#

the gui remains invisible

pale oriole
#

for your first time every trying to script you are doing a really good job btw. i didnt learn about set and get attribute until i was scripting for over 6 months... i used boolValues and intValues for most of that time

thick furnace
#

that results in this error

thick furnace
#

these two scripts are actually the first ones ive written that i didn't just copy

flat perch
#

misunderstood 🙏

thick furnace
#

omg

#

OMG

#

that works !!!

flat perch
#

coolio

thick furnace
#

omg thank you so much !!!!!

flat perch
#

its allg

#

theres much more i couldve said that wouldve made it a little easier to understand

thick furnace
#

it works perfectly as it should oh my goddd this took hours