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

Why isn't my wall jump script not working at giving the player AirCoins?

Asked by 5 years ago

I was modding a script from "Art of parkour" and I was trying to give the player AirCoins every time they wall jump, but the error says:
Players.(the player).Backpack.KeyBindings:34: attempt to index local 'plr' (a nil value)
and the script goes like this:

player.Character.InteractPart.Touched:connect(function(part)
    if part.CanCollide == true then
        wallJumpReady = true
        mouse.KeyDown:connect(function(key)
            key = key:lower()
            if key:byte() == 32 and wallJumpReady == true then
            local plr = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
            plr.leaderstats["AirCoins"].Value = plr.leaderstats["AirCoins"].Value + 1
                torso.Velocity = torso.CFrame.lookVector * 50 + Vector3.new(0,80,0)
                wallJumpReady = false
            end
        end)
        part.TouchEnded:connect(function(torsoPart)
            if torsoPart == player.Character.InteractPart then
                wallJumpReady = false
            end
        end)
    end
end)

Please help!

0
Where is this script located and what is interact part and where is that located? Prestory 1395 — 5y
0
Can you put the whole script in? We kinda only have up till line 19. Also I feel like your problem is that you are just not referencing the player properly, or this is not in a local script greenhamster1 180 — 5y
0
Prestory, you dont get the script and greenhamster1, I don't want my script getting stolen. AnotherPerson_999 28 — 5y

Answer this question