Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

[Solved] Cloning reapting fixing the error maybe someone know why ?

Asked by 5 years ago
Edited 5 years ago

Hello everyone,

I'm trying to clone a folder i try to find the error editing and editing and editing but i can't find it

****Workspace.Part.Script: Line12: attempt to index a nil value****

db = false

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
        if db == false then
            db = true
warn("Player: " ..plr)          
            script.Parent.BrickColor = BrickColor.new("Bright red")
            plr.playerdata.Crowns.Value = plr.playerdata.Crowns.Value + 2

            game.Lighting.Animation.Crowns:Clone().Parent = game.Players:FindFirstChild(plr):FindFirstChild("PlayerGui")
            game.Players:FindFirstChild(plr):FindFirstChild("PlayerGui").Crown.TextLabel.Text = "+ 2"   

            wait(2)
            script.Parent.BrickColor = BrickColor.new("Bright green")
            db = false
        end
    end
end)

Cockerel's Arshyheute um 11:19 Uhr Just do plr.PlayerGui

1 answer

Log in to vote
1
Answered by
arshad145 392 Moderation Voter
5 years ago

Solved in discord.

Ad

Answer this question