Change a Gui only when player is touching a brick?
Alright, so I have a brick that has a Script in it and what I need this script to do is change a Players Money Gui but ONLY when the Player is touching the Brick. So far it has not gone right. I am not sure whats wrong but it is just not working. Also there is an error on one of the End's. Here it is:
01 | local money = game.Workspace.player.PlayerGui.MoneyGui |
02 | local paybrick = script.Parent |
05 | function payperson(player) |
07 | if player.PlayerGui.Job.Jobname.Text = = "Cashier" then |
08 | MoneyGui.Value = 0 + 10 |
12 | until (player.touched = = false ) |
16 | script.Parent.touched:connect(payperson) |
So it should not be that hard of a Script but I can not figure it out. Also in the MoneyGui is another script that should keep the players money so as the player makes money the Gui shows that without the player having to reset, not sure if it would help but here is that script:
1 | local money = script.Parent |
2 | local playermoney = script.Parent.Value |
5 | player.PlayerGui.money.Text = playermoney.Value .. '$' |
No errors with this one as far as I know. I really need some help as to why the first script wont work though. I have no idea what an <eof> is and I am just clueless as to what is wrong. I am not very "Advanced" I know the bare bone basics and I am trying to push what I know with this game.