For some reason this isn't working, can any of you help me with this? Since calling a function would be easier then typing out the same code over and over I would like to try to make this work. Yes, I am aware that there are codes for this already out there but that's not gonna help me learn as if I can't write a simple function then I wont be able to write a complex one when the time comes. All help is appreciated. Here is my script: > '\\\\\\\\\\\\\\\\\ GET FREE SLOT SCRIPT //////////////////////// > Function GetFreeItemSlot(Index) > slot = 1 > Do While int(slot) < 25 > If GetPlayerInvItemNum(Index, Int(slot)) = 0 Then > slot = 25 > GetFreeItemSlot(Index) = 1 > End If > Loop > End Function > '//////////////// END FREE SLOT SCRIPT \\\\\\\\\\\\\\\\\\\\\\\\\ And here is the Case: > Case 5 > If GetFreeItemSlot(Index) = 1 Then > Call PlayerMsg(Index, "Win", 14) > Else > Call PlayerMsg(Index, "Fail", 14) > End If > Exit Sub Thanks