Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't this experience script working?

I am having trouble with this leaderboard script. When a npc is killed with a linkedsword, you gain experience.

game.Players[tool.Parent.Name].leaderstats.Experience.Value = game.Players[tool.Parent.Name].leaderstats.Experience.Value + 100

Error in output: Players.Player1.Backpack.LinkedSword.experience:1: attempt to index global 'tool' (a nil value)

1 answer

Understand.

The issue here is that you simply don't understand how it works. You are not connected to any events, and most importantly you have not declared tool. This means that instead of attempting to understand the function, you have merely attempted to comprehend the function.

Learn

None of us got here without learning, however there are no shortcuts you can take in learning. Do it once, do it right, understand and improve, but do not dare to come back here with this kind of blatant lack of understanding where you have copied concepts too far from your depth.

6 comments

1

Thank you for the answer, I will learn more before I ask again. I don't, however appreciate the way to were talking to me in the chat.

0

I don't appreciate the blatant lack of understanding. It's lazy.

1

I don't think calling a member of your site "Inbred" is an appropriate response to anything. You are also showing a blatant lack of understanding my family.

0

C'est la vie.

0

C'est la vie.

0

à toi aussi

This discussion is preserved as it was. New answers, comments, and votes are closed.