blacks are dumb lol this was edited
Here's a simple example,
Let's say the player wants to level up to level 2, First, he will need to get a certain amount of XP and now, how would we implement that? Easy! first we are going to make the XP value and the Level value
local XP = Instance.new("IntValue") local Level = Instance.new("IntValue")
We created the Values! But what now you ask? We are going to compare numbers, so when the player reaches a certain amount of XP he levels up! and we do that by using an IF statement
local NeededXP = 500 if XP.Value == NeededXP then Level.Value = Level.Value + 1 end
Now we completed the mission, but wait! What if we want to increase the amount of XP needed to level up. Simply we double(or increase however you want) the value of NeededXP and we do that by using this way
NeededXP = NeededXP * 2 --(we double the number)
And thats it!
Completed script:
--Creating values. local XP = Instance.new("IntValue") local Level = Instance.new("IntValue") --Creating a value to compare the XP with local NeededXP = 500 -- We compare the XP with the NeededXP and check if they are the same! if XP.Value == NeededXP then Level.Value = Level.Value + 1 --Increase the level by 1 NeededXP = NeededXP * 2 --Double the NeededXP to level up! end
Good luck scripting!
Closed as Not Constructive by minikitkat
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?