of     1   

Pickles44456
#215499251Friday, April 28, 2017 8:32 PM GMT

Hi! I'm very new to scripting, so apologies if this isn't explained very well. I have a script where if somebody steps on a hat and they have enough money, it will give them the hat. If they do not have enough money, I wanted it to come up with a ScreenGUI stating they don't have enough money. I disabled the ScreenGUI and went into test mode. I tried to step on the hat without enough money to purchase it and it didn't enable the ScreenGUI. It's enabling it in the ScreenGUI properties in the bottom of the screen but it is not coming up on my screen. Thanks in advance if anybody can help me! Here is the script: --------------------------------------------------------------------------------- local hair = game.Workspace["Cool Hair"] function onTouch() if game.Players.Player1.leaderstats.Money.Value == 100 then hair.give.Disabled = false game.Players.Player1.leaderstats.Money.Value = (game.Players.Player1.leaderstats.Money.Value - 100) else game.StarterGui.No.Enabled = true end end script.Parent.Touched:connect(onTouch)
Nuclear_Energy
#215499333Friday, April 28, 2017 8:33 PM GMT

your coding logic is not good...Lots of potential bugs...MakeRobloxGreatAgain
Pickles44456
#215499420Friday, April 28, 2017 8:35 PM GMT

I just started coding today so I figured, like I stated at the top of my post. Thanks anyways.
Nuclear_Energy
#215499504Friday, April 28, 2017 8:36 PM GMT

If you are new to coding, then the scripting forum is not for you... You first have to learn by experimenting and fixing problems yourself if you want to learn how to become great at scripting
Pickles44456
#215499665Friday, April 28, 2017 8:39 PM GMT

Thank you for your advice. I am still trying to solve this right now and get better, I was just curious if the problem I was having with the GUI being enabled and not showing up was something I had written in there wrong. I am also trying to see if other people would help me learn this :)
LaeMVP
#215500450Friday, April 28, 2017 8:53 PM GMT

1. That code would only pass the first if statement if the player's name is 'Player1' 2. Is hair supposed to be a gui? If so why is it in workspace? 3. Making changes in StarterGui won't do anything.
Pickles44456
#215500776Friday, April 28, 2017 8:59 PM GMT

1. Okay! I figured that would be the case. I'll start trying to find my fix for that. It's working in studio so far, but of course I figure that's because when I join, it shows me as 'Player1' and not 'Pickles44456'. 2. Hair is the hat that is put on when you step on it. It's a brick. Thanks for your response ^^

    of     1