Not Understandable Error

No, i edited it to let you see line 101

I’m not sure what you’re doing, but it worked perfectly fine on my end after commenting out the getShirt function. This was because it had an http request.

personally was thinking of something like this

if shirtsBought >= 40 then
	-- yadda yadda
elseif shirtsBought >= 30 then
	return "Insane Buyer"
elseif shirtsBought >= 25 then
	return "Nike Obsession"
-- etc etc etc

but i think it overall comes down to preference when it comes to that.
anyway, the actual issue i THINK is… well, i’ve never seen scripts do this, but when you define a function, i don’t think you’re to do this:

local getRank = function(shirtsBought, playerGuy)

but rather:

local function getRank(shirtsBought, playerGuy)

this MIGHT be where the issue is coming from

Okay, but I’m pretty sure both do the same thing.

try it first at least? specifically, the way the function was written. because, i’m not sure if it works like this or not since i’ve never written functions like that before, but it looks like it’s trying to call a value rather than a function when you type getRank(). though, i could also be 100% wrong.

also, noticed that if shirtsbought >= 40, then it returns groupInfo[playerGuy:GetRankInGroup(11352987)]. does this return as a string?

Can you just copy and paste line 101 for me? Is it the line

local getRank = function(shirtsBought, playerGuy)

Is it that line?

No, its the line where i use the function getRank(), not set it.

Can you tell me which line in the function getRank? There are too much lines in the function getRank()

No i mean, at the bottom of the script, i USE the function getRank() and thats the only occurrence that I USE THE FUNCTIOn, not create it.

The line is NOT in the function. the line is where i USE the function.

tell me if that is still unclear :smiley:

Let me tell you. There is an error IN the function. When you CALL the function, the error will also be there. So play the game and call the getRank() function. You will get TWO errors. screen shot the FIRST one to me :slight_smile: Sorry I’m trying to be clear, no offense :slight_smile:

But the error is stating that there is a missing paremeter, not something wrong in the function…

When you are calling the function how many errors did you get in the output box?

1 Error, and it is the Paremeter Error

(String expected, got nil) on the 3rd parameter, which doesn’t exist!!

Hmmm. Let me check the code again. Give me a second

Hey, did you call the function in the same script?

Actually, can you show me the line where you called the function?

I Restarted studio and it worked. I guess its just a studio error.

Noooooooooo I wasted my time :frowning: