Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Anything Wrong with this sub?


JayT
 Share

Recommended Posts

hey… my scripted item sub seems to not be working when i double click any of my scripted items...can someone take a look plz and help me out lol
```
' Executes whenever a scripted item is used or double clicked.
Sub ScriptedItem(Index, Script)
  Select Case Script

      case 3
  Call PutVar("Accounts\" & GetPlayerLogin(Index) & "\" & GetPlayerName(Index) ".ini", "EXTRAS", "DOUBLEEXP", "1")
  Call PlayerMsg(Index, "For the next hour, you will have double-EXP", WHITE)
  Call PlayerMsg(Index, "Please do not logout, or the item's effect will stop early", WHITE)
  Call SetTimer("RemoveExp " & Index, 3600000)
  Call TakeItem(Index, 81, 1)

Exit Sub

      case 4

      call playerwarp(Index, 12, 3, 14)
      Call TakeItem(Index, 45, 1)
      call playermsg(index, "The scroll fizzles up as you drift into a different location.", 1)

Exit Sub 

      case 5
  call playerwarp(Index, 18, 17, 19)
        Call TakeItem(Index, 62, 1)
        call playermsg(index, "The scroll fizzles up as you drift into a different location.", 1)

  Exit Sub

      Case Else
      Call PlayerMsg(Index, "No use", 1) 
  Exit Sub
End Select

End Sub
```
Link to comment
Share on other sites

nice 1 that sorted that out but my take item isnt workin for some reason. i have godlords inv script in a different file and added the include into my main but it still dont take the items away when they are double clicked
Link to comment
Share on other sites

@Bobosk:

> Have you tried it without the includes..? because i haven't messed around with them, though i suppose it's about time that i do.. :/

Include is very easy to use, just make sure there's a space between #include and .

> #include

Regards,
  Godlord.
Link to comment
Share on other sites

I never assumed they were "hard" to use… i just didn't feel the urge to try them.. and now people are all willy nilly about using Admiral's Main.txt with #Include's.. which isn't a big deal to me, as it just means i need to get used to another SadScripter's Idealism.

However, I myself still prefer the old way of giant Main.txt :D
Link to comment
Share on other sites

@Bobosk:

> I never assumed they were "hard" to use… i just didn't feel the urge to try them.. and now people are all willy nilly about using Admiral's Main.txt with #Include's.. which isn't a big deal to me, as it just means i need to get used to another SadScripter's Idealism.
>
> However, I myself still prefer the old way of giant Main.txt :D

Well it exists since TE, but nobody really used it back then. I only used it in the Inventory Script I posted.

Regards,
  Godlord.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...