server script:
01 | f = false |
02 | script.Parent.MouseButton 1 Click:Connect( function () |
03 | if not f then |
04 | f = true |
05 | for i,v in pairs (game.Workspace:GetChildren()) do |
06 | if v.Name:match(script.Parent.Parent.Parent.Parent.Parent.Name) then |
07 | local player = game.Players:GetPlayerFromCharacter(v) |
08 | if player.leaderstats.Money.Value > = 15 then |
09 | player.leaderstats.Money.Value = player.leaderstats.Money.Value - 15 |
10 | script.Parent.Parent:Destroy() |
11 | end |
12 | end |
13 | end |
14 | end |
15 | end ) |
on line 6 it says
1 | Players.world_kiIIer.PlayerGui.rank.Frame.yes.yes: 6 : attempt to index field 'Parent' (a nil value) |
why does this happen?
Double check your parent directory, the only feasible error is that you're using too many .Parent addresses, and you eventually called for the parent of the game, which is nil.