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)

5 comments

0

Why is line 1 so ridiculously long? Same for lines 4-6. Why so many script.Parent’s?

0

idk

0

Either Player.Character.Money or script.Parent.Parent.Parent.PriceValue does not exist.

0

lord have mercy O_o. Mind putting the first bit in a code block as well?

0

np