Ad
Log in to vote
0

attempt to index a nil value?

Asked by 10 days ago
Edited 10 days 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)

0
Why is line 1 so ridiculously long? Same for lines 4-6. Why so many script.Parent’s? incapaz 3232 — 10d
0
idk mrbong011 -5 — 10d
0
Either Player.Character.Money or script.Parent.Parent.Parent.PriceValue does not exist. Scarious 203 — 10d
0
lord have mercy O_o. Mind putting the first bit in a code block as well? T0XN 263 — 10d
0
np mrbong011 -5 — 10d

Answer this question