I'm new to scripting and not really sure how to do much. As of right now I'm trying to figure out a tree chopping system. A system in which you'll chop down a tree and receive wood, where you'll then be able to sell it for money. I'm also confused on how to add more gamepasses to my in game shop. I have a full working in game shop with 4 passes already, I'm unsure as to how to add more into the script though. Any help is very appreciated!❤️
#Need Help With 2 Scripts
1 messages · Page 1 of 1 (latest)
script a health attribute that gives wood to leaderstats when it hits zero, then use a sell part to swap that wood for money.
for gamepasses, just add the new IDs to the table in your shop script so your existing loop can generate the extra buttons.
This is my shop and my script for my gamepasses. How would I make the new gamepasses different from the others. Making them assigned to specific buttons? I watched a tutorial on what I currently have which I why it's a bit hard understanding how to add my own stuff.
you can add a new line in the Gamepasses table like ["Gamepass5"] = ID_HERE. make sure the name you use in the brackets matches the name of the button object in your explorer exactly so the script knows which is which.
Would this be the button object youre talking about?
Yeah, Purchase is the button players click, but the name in your script like Gamepass1 has to match that parent frame name
Ohhhhh, I understandd, So i'll just match the script name with the button name, like how i did for "gamepass1" and so on
Exactly
Just make sure the name in the ShopInfo.Gamepasses table matches the name of the folder or frame in your Explorer
If you create a "Gamepass5" in the UI, you'll just add a matching ["Gamepass5"] = ID entry to your script
Meaning I have to make a new line that would say something like "ShopInfo.Purchase"? and put the new IDs under that?
** You are now Level 1! **
no. keep it inside the ShopInfo.Gamepasses table. Just add a new line like ["Gamepass5"] = ID_HERE, right under the first four.
the script uses that name to find the right frame in your ui
Ohhh yes okay, just make sure the name matches with the button though, sorry i misunderstood that
So the script should match with the button name? or the Frame name?
Match the Frame name (like Gamepass1). The script uses that name to find the container, and then it looks inside that container to find the Purchase button automatically.
So if you duplicate the folder and name it SpeedCoil, your script line should be ["SpeedCoil"] = ID_HERE.
It's kind of confusing tho, because the gamepasses I already have setup have the same name as the ones I'd like to setup
alright
if you have two "VIP" passes, name the first frame VIP1 and the second VIP2 in the Explorer. Then in your script, just make sure those exact names match the keys in your table.
Basically Frame Name in Explorer = Name in the brackets [" "].
Like, the ones I already did are under a Frame called "Cash" but the buttons on the inside are named "Gamepass1". But now I'm trying to add more gamepasses, and the new ones are under a Frame called "Gamepasses". The buttons for the gamepasses are also all named "Purchase"
That's where the confusion is.. your script is looking for the names inside ShopInfo.Gamepasses, and it doesn't care about the "Purchase" button name.
If your new gamepasses are inside that "Gamepasses" frame, just make sure each individual container for those passes (the parent of the button) has a unique name like Gamepass1, Gamepass2, etc., in the Explorer.
So I should change the name of "Container" Or "Gamepasses" Orrrr the button "Purchase
I'm sorry I'm being so difficult, I'm very new to all this coding stuff💔
You're not being difficult at all, this is how everyone learns
If you want a new pass, duplicate that Gamepass1 frame and rename the copy to Gamepass5. Then, in your script, make sure you have a line that says ["Gamepass5"] = YOUR_ID_HERE. The script looks for that specific frame name first, then it finds the "Purchase" button hiding inside it automatically.
Ohhhh okay
I think, I understand noww
Thank you for the help! Really appreciated🙏🏻
You're welcome
Shop: Premium quality, Gameplay: Poopity boopity poop 💩