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

Is this a valid script?


SawQuart
 Share

Recommended Posts

No worries. No, that will not work.

```
Case 1
Call PlayerMsg(index,"You are now fishing", BLUE, 0)
Call PlayerScriptedItems(index, item=1+1)
End Case
```
There are several reasons. First, PlayerMsg has only 3 parameters. The 4th is used in BattleMsg, but not PlayerMsg. Second, there's no command called PlayerScriptedItems, and item=1+1 is not valid syntax. If you are giving an item, I suggest grabbing up an inventory script. Godlord's is quite popular. Check out the script database. The command then would be GiveItem(index, item, amount). Last, you don't need an "End Case". It's not a valid keyword.

Do these things and you'll have something like this:

```
Case 1
Call PlayerMsg(index,"You are now fishing", BLUE)
Call GiveItem(index, FISHITEMNUMBER, FISHAMOUNT)

```
Link to comment
Share on other sites

Yeah, there are other options, but it's the same thing as those functions. You loop and find an inventory slot then change the data there. It's just that you'd only need one line to do so instead of like 10 if you just had a pre-made function.

Functions are your friends. :3
Link to comment
Share on other sites

@Balliztik1:

> Yeah, there are other options, but it's the same thing as those functions. You loop and find an inventory slot then change the data there. It's just that you'd only need one line to do so instead of like 10 if you just had a pre-made function.
>
> Functions are your friends. :3

I know. I was just saying that anyway in case 'somehow' he can't install an inventory script.
functions are awesome i know xD
Link to comment
Share on other sites

@[SawQuart:

> Jungletoe link=topic=50718.msg529702#msg529702 date=1250984947]
> What about if I want a chance of a fish, plus some fishing exp.

That's where things get fun. Check out the Rand(), GetVar(), and PutVar() commands. You can generate a random number, do your calculations as such, then award EXP or not. The EXP will be placed inside a .ini file, added to the value that's already there.

There's a ton of fishing/skill scripts out there. Check out what they did if you're confused on how this works.
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...