So heres what the script is sapose to do, you buy an they item by clicking on the button, it takes away 10 cash, then changes an textlabels text to true
I tried to test it on play mode, it it takes away money but it dosent change the text label text
I have a diagram of the heirarchy of the items, The textlabel is in the gui called Shop
Please tell me what the problem is c;
Image1 --> http://prntscr.com/9upeja Image2 --> http://prntscr.com/9upezl Image3 --> http://prntscr.com/9ur7w9
Anything that helps is appreciated
Cash = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Cash function onClick() local Item = script.Parent.Parent.Parent.Parent.Inventory.Background3.Frame.Item.HasBought if Cash.Value >= 10 then Cash.Value = Cash.Value - 10 wait(.2) script.Parent.Parent.Parent.Parent.Inventory.Background3.Frame.Item.HasBought.Text = "True" end end script.Parent.MouseButton1Click:connect(onClick)
1) The MouseButton1Down event only works in LocalScripts, so I'd change that 2) You seem to be a Parent short on your "Cash" variable, I'd recommend revising that.
IRRELEVANT, QUESTION WAS EDITTED