My store gui does not work when I click to buy the item. Here is the script:
player = script.Parent.Parent.Parent.Parent.Parent kills = player.leaderstats.Knockouts Item = game.ReplicatedStorage.SpeedCoil function buy() if kills.Value >= 8 then kills.Value = kills.Value - 0 Item:clone().Parent = player.Backpack wait(2) else script.Parent.Text = "Not Enough Funds" wait(3) script.Parent.Text = "Speed Coil" end end script.Parent.MouseButton1Down:connect(buy)
Possible diagnostics:
- not in a LocalScript
- Active property of the Gui object is false
- Gui object is not a button
I tried to make a different one an had no luck, no errors or even outputs were given. Whats wrong here?
Cash = script.Parent.Parent.Parent.Parent.Parent.leaderstats.KOs function onClick() if Cash.Value >= 8 then Cash.Value = Cash.Value - 0 local item = game.ServerStorage.SpeedCoil:clone() item.Parent = script.Parent.Parent.Parent.Parent.Parent.StarterGear item.Parent = script.Parent.Parent.Parent.Parent.Parent.Backpack print("Yay") else script.Parent.Text = 'Nope' wait(3) script.Parent.Text = 'Speed Coil' print("Yay?") end end script.Parent.MouseButton1Click:connect(onClick)