attempt to index a nil value?
Asked by
5 years ago Edited 5 years ago
15:39:36.174 - Players.MrBong011.PlayerGui.Msg.ShopUI.ShopFrame.Template.Base.Purchase.TextButton.Script:9: attempt to index a nil value
15:39:36.175 - Stack Begin
15:39:36.176 - Script 'Players.MrBong011.PlayerGui.Msg.ShopUI.ShopFrame.Template.Base.Purchase.TextButton.Script', Line 9
15:39:36.176 - Stack End
repeat wait() until script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name ~= "Head"
Debounce = false
Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
Price = script.Parent.Parent.Parent:FindFirstChild("PriceValue")
Gun = script.Parent.Parent.Parent.Parent:FindFirstChild("Gun")
script.Parent.MouseButton1Click:connect(function()
if Debounce == false and Player.Character:FindFirstChild("Money").Value >= Price.Value then
Player.Character:FindFirstChild("Money").Value = Player.Character:FindFirstChild("Money").Value - Price.Value
wait()
game.ServerStorage.Weapons:FindFirstChild(Gun.Text):clone().Parent = Player.Backpack
end
end)