Vikola Posted July 20, 2009 Author Share Posted July 20, 2009 ok well im trying to make scripted items and im trying to make the item disappear after usei use the code:```Call TakeItem(Index 18, 1)```18 being the item #and 1 being how many to takethe item im making is a warp item and it warps but doesnt disappearim using eclipse 2.8thx :cheesy: Link to comment Share on other sites More sharing options...
DarkSpine Posted July 20, 2009 Share Posted July 20, 2009 You have godlord's inventory script, right? If you don't, you'll need to find that, if you do have it, I don't see why it isn't working.Post the entire script and I might be able to debug it. Link to comment Share on other sites More sharing options...
Vikola Posted July 20, 2009 Author Share Posted July 20, 2009 ok i just got the inventory script and it still isnt disappearingthis is my sub:```' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case Script Case 0 Call PlayerWarp(Index, 6, 9, 7) Call TakeItem(Index, 18, 1) Exit Sub End SelectEnd Sub```it seems plain lol Link to comment Share on other sites More sharing options...
Squiddle Posted July 20, 2009 Share Posted July 20, 2009 Does it give you a Run Time Error, causing a pop-up message or a crash? Link to comment Share on other sites More sharing options...
Vikola Posted July 20, 2009 Author Share Posted July 20, 2009 @[SB:> [Squi] Squiddle link=topic=48658.msg502005#msg502005 date=1248132082]> Does it give you a Run Time Error, causing a pop-up message or a crash?nopeall it does is warp me to Zulon (map 6) and not disappear=/ Link to comment Share on other sites More sharing options...
Squiddle Posted July 20, 2009 Share Posted July 20, 2009 Are you sure that you have the right prefixes in? If you do, then it might be because that you can't use that function inside of the item you wish to take. Double check your prefixes, and also try reloading the script/Closing and Openning the Server. Link to comment Share on other sites More sharing options...
Vikola Posted July 20, 2009 Author Share Posted July 20, 2009 ermm.. prefixes? Link to comment Share on other sites More sharing options...
Squiddle Posted July 20, 2009 Share Posted July 20, 2009 Prefixes / Properties/ Blah blah blah, the variables you put in, the "INDEX, 18, 1". If it still doesn't work, I think I have a fix.Put this at the bottom of your main.txt:```Sub TakeWarp(Index) Call TakeItem(Index, 18, 1)End Sub```And replace your Scripted Item sub with this:```' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case Script Case 0 Call PlayerWarp(Index, 6, 9, 7) Call TakeWarp(Index) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Vikola Posted July 21, 2009 Author Share Posted July 21, 2009 it still wont disappear >.< Link to comment Share on other sites More sharing options...
azure Posted July 21, 2009 Share Posted July 21, 2009 This was stated above, but have you put in the "take" functions yet? I had a similar problem and after adding all the proper functions at the bottom of my main it worked perfectly. Link to comment Share on other sites More sharing options...
Vikola Posted July 21, 2009 Author Share Posted July 21, 2009 "take" functions?sorry i just started scripting a couple days ago Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 21, 2009 Share Posted July 21, 2009 @Vikola:> "take" functions?> sorry i just started scripting a couple days agoYou said you installed "inventory" scripts; could you link us to those scripts?The TakeItem sub is not default in the engine, so will have to be programmed into the Main.txt before it can be called. Link to comment Share on other sites More sharing options...
Vikola Posted July 21, 2009 Author Share Posted July 21, 2009 oh okthis is the script i installed:http://www.touchofdeathforums.com/smf/index.php/topic,28174.0.html Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 21, 2009 Share Posted July 21, 2009 And you've saved your Main.txt, and reloaded your scripts via Server Control Panel, right?Is the item you are trying to take a stackable item?Go back to that sub you are using:```' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case Script Case 0 Call PlayerWarp(Index, 6, 9, 7) Call TakeItem(Index, 18, 1) Exit Sub End SelectEnd Sub```It's suppose to take 1 of item 18, correct? Link to comment Share on other sites More sharing options...
Vikola Posted July 21, 2009 Author Share Posted July 21, 2009 yes 1 tele-gemtele-gem is #18but it is not stackable Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 21, 2009 Share Posted July 21, 2009 There is no reason this shouldn't work.You did reload your scripts, right?Upload your main.txt, let me take a look as to why it isn't running; may be something else. Link to comment Share on other sites More sharing options...
Vikola Posted July 21, 2009 Author Share Posted July 21, 2009 ok here it is:```' Eclipse Evolution 2.7 Scripting File' Global VariablesPublic GameNamePublic MAX_MAPSPublic MOTD' Color ConstantsPublic Const BLACK = 0Public Const BLUE = 1Public Const GREEN = 2Public Const CYAN = 3Public Const RED = 4Public Const MAGENTA = 5Public Const BROWN = 6Public Const GREY = 7Public Const DARKGREY = 8Public Const BRIGHTBLUE = 9Public Const BRIGHTGREEN = 10Public Const BRIGHTCYAN = 11Public Const BRIGHTRED = 12Public Const PINK = 13Public Const YELLOW = 14Public Const WHITE = 15' Admin ConstantsPublic Const ADMIN_MONITER = 1Public Const ADMIN_MAPPER = 2Public Const ADMIN_DEVELOPER = 3Public Const ADMIN_CREATOR = 4' Executes when the server initially loads.Sub OnServerLoad() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when the scripts are reloaded.Sub OnScriptReload() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes the MOTD is changed by the client.Sub ChangeMOTD() MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when a new character is created.Sub OnNewChar(Index, CharNum)End Sub' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds) If Minutes = 0 Then If Seconds = 0 Then Call AdminMsg("Don't forget to vote for Eclipse.", YELLOW) End If End IfEnd Sub' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End IfEnd SubSub OnArrowHit(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End IfEnd SubSub PlayerHit(Index, NPCNum, Damage) If Damage > 0 then Call NPCAttack(NPCNum, Index, Damage) End IfEnd Sub' Executes when a hotkey is pressed client-side.Sub HotScript(Index, KeyID) Select Case KeyID ' Executes when any player presses the PageUp key. Case 1 ' Executes when any player presses the Delete key. Case 2 ' Executes when players press the End key. Case 3 ' Executes when players press the PageDown key. Case 4 End SelectEnd Sub' Executes when something on a custom menu is clicked.Sub MenuScripts(Index, Clicked_Index, Menu_Type) Dim MenuTitle Dim FieldMessage MenuTitle = getplayermenuclicktitle(Index) FieldMessage = getplayermenuclickmsg(Index) Select Case Menu_Type Case 1 Call PlayerMsg(Index, "Clicked picture number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) Case 2 Call PlayerMsg(Index, "Clicked field number " & Clicked_Index & " on the menu named " & MenuTitle & ". The field text was " & FieldMessage, YELLOW) Case 3 Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) End SelectEnd Sub' Executes when a player logs into the game.Sub JoinGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index)End Sub' Executes when a player logs out of the game.Sub LeftGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW) End IfEnd Sub' Executes when a players experience exceeds the next level requirement.Sub PlayerLevelUp(Index) Dim TotalExp Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) TotalExp = GetPlayerExp(Index) - GetPlayerNextLevel(Index) Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 1) Call SetPlayerExp(Index, TotalExp) Loop Call BattleMsg(Index, "You have " & GetPlayerPOINTS(Index) & " stat points.", BRIGHTBLUE, 0)End Sub' Executes when a player uses one of the points given on an attribute to level up.Sub UsingStatPoints(Index, PointType) Select Case PointType Case 0 If GetPlayerSTR(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your strength!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 1) Call BattleMsg(Index, "You have gained more strength!", WHITE, 0) Case 1 If GetPlayerDEF(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your defence!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 1) Call BattleMsg(Index, "You have gained more defense!", WHITE, 0) Case 2 If GetPlayerMAGI(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your magic!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerMAGI(Index, GetPlayerMAGI(Index) + 1) Call BattleMsg(Index, "You have gained more magic!", WHITE, 0) Case 3 If GetPlayerSPEED(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your speed!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerSPEED(Index, GetPlayerSPEED(Index) + 1) Call BattleMsg(Index, "You have gained more speed!", WHITE, 0) End Select ' Remove one point after the sub in question is done Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) - 1)End Sub' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 If GetPlayerGender(Index) = 0 Then Call PlayerWarp(Index, 1, 1, 1) Else Call PlayerWarp(Index, 2, 2, 2) End If Call SendPlayerData(Index) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executes when a player clicks on an OnClick tile.Sub OnClick(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Out-dated: Executes when a player chooses yes or no on a player prompt.Sub PlayerPrompt(Index, Prompt, Value) If Prompt = 6 Then Select Case Value Case 0 Call GlobalMsg("Hi This is a Yes answer!", CYAN) Case 1 Call GlobalMsg("This is case 1?", CYAN) End Select Else Select Case Value Case 0 Call GlobalMsg("Hi This is a No answer!", RED) Case 1 Call GlobalMsg("This is no case 1?", RED) End Select End IfEnd Sub' Out-dated: Executes query box responses.Sub QueryBox(Index, Prompt) Value = GetVar("responses.ini", "Responses", CStr(Index))End Sub' Executes every time a player drops an item.Sub OnItemDrop(Index, Map, ItemNum, ItemVal, ItemDur, ItemIndex, InvSlot)End Sub' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)End Sub' Executes whenever an NPC is killed.' Note: Death occurs as normal externally to this script.Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex) Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", BRIGHTRED, 0)End Sub' Executes when a player is killed by another.' Note: Death occurs as normal externally to this script.Sub OnPVPDeath(Attacker, Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), BRIGHTRED)End Sub' Executes when a player dies in an arena by another player.Sub OnArenaDeath(Attacker, Victim) Dim Map Dim X Dim Y Dim Data1 Dim Data2 Dim Data3 Map = GetPlayerMap(Victim) X = GetPlayerX(Victim) Y = GetPlayerY(Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been defeated in the arena by " & GetPlayerName(Attacker), BRIGHTRED) Call SetPlayerHP(Victim, GetPlayerMaXHP(Victim)) Call SetPlayerMP(Victim, GetPlayerMaXMP(Victim)) Call sendHp(Victim) Call sendMP(Victim) Data1 = GetTileData1(Map, X, Y) Data2 = GetTileData2(Map, X, Y) Data3 = GetTileData3(Map, X, Y) Call PlayerWarp(Victim, Data1, Data2, Data3)End Sub' Executes whenever a player casts a scripted spell.Sub ScriptedSpell(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executed whenever a slash command is sent to the server.Sub Commands(Index) Dim TextSay Dim PlayerID Dim MapNum ' Get the command and arguments from the cache. TextSay = Trim(GetVar("Scripts\Command.ini", "TEMP", "Text" & Index)) ' Split the command into an array. All arguments are seperated by spaces. TextSay = Split(TextSay) Select Case TextSay(0) Case "/testscripts" Call TestMain(Index) Exit Sub Case "/help" Call PlayerMsg(Index, "Social Commands:", WHITE) Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE) Call PlayerMsg(Index, "-msghere = Emote Message", WHITE) Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE) Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE) Exit Sub Case "/calladmins" If GetPlayerAccess(Index) = 0 Then Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN) Else Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN) End If Exit Sub Case "/admin" If GetPlayerAccess(Index) > 0 Then Call PlayerMsg(Index, "Social Commands:", WHITE) Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE) Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE) Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE) End If Exit Sub Case "/warpmeto" If GetPlayerAccess(Index) > 0 Then PlayerID = FindPlayer(TextSay(1)) If PlayerID > 0 Then Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID)) Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", BROWN) Else Call PlayerMsg(Index, "Player is not online.", WHITE) End If End If Exit Sub Case "/warptome" If GetPlayerAccess(Index) > 0 Then PlayerID = FindPlayer(TextSay(1)) If PlayerID > 0 Then Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index)) Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", BROWN) Else Call PlayerMsg(Index, "Player is not online.", WHITE) End If End If Exit Sub Case "/warpto" If GetPlayerAccess(Index) > 0 Then MapNum = TextSay(1) If MapNum > 0 And MapNum <= MAX_MAPS Then Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index)) Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE) Else Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED) End If End If Exit Sub Case "/test" If GetPlayerAccess(Index) >= 4 Then Call PlayerMsg(Index, "Pass", WHITE) Else Call PlayerMsg(Index, You aren't an admin!", RED) End If Exit Sub End Select Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)End Sub' Executes on death, dropping all of the players items.Sub DropItems(Index) If GetPlayerWeaponSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0) End If If GetPlayerArmorSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0) End If If GetPlayerHelmetSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0) End If If GetPlayerShieldSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0) End If If GetPlayerLegsSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0) End If If GetPlayerRingSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0) End If If GetPlayerNecklaceSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0) End IfEnd Sub' Executes whenever somebody dies outside of an arena.Sub OnDeath(Index) Dim MapNum Dim ClassID Dim X Dim Y If GetMapBootMap(Index) > 0 Then Call PlayerWarp(Index, GetMapBootMap(Index), GetMapBootX(Index), GetMapBootY(Index)) Else ClassID = GetPlayerClass(Index) MapNum = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "Map") X = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "x") Y = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "y") Call PlayerWarp(Index, MapNum, X, Y) End IfEnd Sub' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case Script Case 0 Call PlayerWarp(Index, 6, 9, 7) Call TakeWarp(Index) Call SendPlayerData(Index) Exit Sub End SelectEnd Sub' Map AttributesSub SetBlank(Map, X, Y) Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")End SubSub SetBlock(Map, X, Y) Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")End SubSub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY) Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")End SubSub SetItem(Map, X, Y, ItemID, ItemValue) Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")End SubSub SetNPCAvoid(Map, X, Y) Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")End SubSub SetKeY(Map, X, Y, KeyID, KeyTake) Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")End SubSub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message) Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")End SubSub SetHeal(Map, X, Y) Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")End SubSub SetKill(Map, X, Y) Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")End SubSub SetShop(Map, X, Y, ShopID) Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")End SubSub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3) Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")End SubSub SetArena(Map, X, Y, MapID, NewX, NewY) Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")End SubSub SetSound(Map, X, Y, FileName) Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")End SubSub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost) Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")End SubSub SetSign(Map, X, Y, Line1, Line2, Line3) Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)End SubSub SetDoor(Map, X, Y) Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")End SubSub SetNotice(Map, X, Y, Title, Text, FileName) Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)End SubSub SetScripted(Map, X, Y, Script) Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")End SubSub SetBank(Map, X, Y) Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")End Sub' Tests scripts up to the location of Sub TestMain(Index).' Leave this sub at the bottom to test the entire script file.Sub TestMain(Index) Call PlayerMsg(Index, "Scripts are working properly.", BRIGHTGREEN)End Sub Function GetFreeSlots(Index) Dim Slot Dim Slots Slot = 1 Slots = 0 Index = Int(Index) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Slots = Slots + 1 End If Slot = Slot + 1 Loop GetFreeSlots = Slots End Function Sub GiveItem(Index, Number, Durability) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Durability = Int(Durability) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemDur(Index, Slot, Durability) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Sub GiveCurrency(Index, Number, Amount) Dim Slot Dim CurrentAmount Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemValue(Index, Slot, Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop End Sub Function CanTake(Index, Number, Amount) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CanTake = True Exit Function End If End If Slot = Slot + 1 Loop CanTake = False End Function Sub TakeItem(Index, Number, Amount) Dim Slot Dim CurrentAmount Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) If CurrentAmount <= Amount Then Call SetPlayerInvItemNum(Index, Slot, 0) Call SetPlayerInvItemValue(Index, Slot, 0) Call SetPlayerInvItemDur(Index, Slot, 0) Call SendInventoryUpdate(Index, Slot) Else Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount) Call SendInventoryUpdate(Index, Slot) End If Exit Sub End If End If Slot = Slot + 1 Loop End SubSub TakeWarp(Index) Call TakeItem(Index, 18, 1)End Sub``` Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 21, 2009 Share Posted July 21, 2009 I don't see any issues in this main, nor any issues as to why it shouldn't work.Let's wait to see if another scripter sees any problems with it. Link to comment Share on other sites More sharing options...
Vikola Posted July 21, 2009 Author Share Posted July 21, 2009 alright =/ Link to comment Share on other sites More sharing options...
DarkSpine Posted July 29, 2009 Share Posted July 29, 2009 I still see no problem, but try switching the playerwarp and the TakeItem, so it takes the item and then warps.That most likely won't do anything, but I always say that and then it works xD Link to comment Share on other sites More sharing options...
Diskmaster Posted July 29, 2009 Share Posted July 29, 2009 OMG, I have had this problem too, question 1, is your teleporting item stackable, or not! If its not, then we have a problem, try this:Call TakeItem(index, 18, 0)I stress the 0, this is because 1= 1 of a stackable, 0= 1 of a non-stackable, -1= 1 of a non-stackable(i don't understand how to use this one tho.Question 2, did u put in the right number for the item (ex: The teleport item= 17, not 18)I hope I could help! Link to comment Share on other sites More sharing options...
DarkSpine Posted July 29, 2009 Share Posted July 29, 2009 Actually Diskmaster, I have always used Call TakeItem(Index, num, 1) to take 1 of a non-stackable item, and it works fine for me.I guess the only other possible thing is what you said, the wrong item.If even that does not work, I'd try reinstalling Godlord's inventory script.(Btw, I had been fixing your scripts Diskmaster by changing the 0's in the take Item to 1s xD) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now