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

Wrong tilescript?


kuroda
 Share

Recommended Posts

i use this script but i dont know how doesnt work :S

Sub ScriptedTile(index)

case 0
                GetPlayerLevel(index)

    If PlayerLevel(index) > 6 then

Call BlockPlayer(index)

Call PlayerMsg(index, "[Attention]Your not the right level to enter this area",

7)

Else

      If PlayerLevel(index) < 6 then

call playermsg(index, "welcome to the level 6+ area", 4)

end if

end if
end sub
Link to comment
Share on other sites

```
Sub ScriptedTile(index)
Case 0
If GetPlayerLevel(index) > 6 Then
Call BlockPlayer(index) ' I'm not shure if that will work.
Call PlayerMsg(index, "[Attention]Your not the right level to enter this area", 7)
Else
If GetPlayerLevel(index) < 6 Then
Call PlayerMsg(index, "welcome to the level 6+ area", 4)
End If
End If
End Sub
```Try that.
Link to comment
Share on other sites

@[NW:

> [CUBE] Sean link=topic=39585.msg385413#msg385413 date=1235758385]
> ```
> Sub ScriptedTile(index)
> Case 0
> If GetPlayerLevel(index) > 6 Then
> Call BlockPlayer(index) ' I'm not shure if that will work.
> Call PlayerMsg(index, "[Attention]Your not the right level to enter this area", 7)
> Else
> If GetPlayerLevel(index) < 6 Then
> Call PlayerMsg(index, "welcome to the level 6+ area", 4)
> End If
> End If
> End Sub
> ```Try that.

Wont work.

If GetPlayerLevel is LESS THAN 6 then
Welcome to the 6+ area?
Link to comment
Share on other sites

Give this a whirl, havent tested since i havent got Eclipse, so back up your main.txt first!

```
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.'
Sub ScriptedTile(index)
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
  Case 0
  If GetPlayerLevel(index) > 6 Then
  Call PlayerMsg(index, "[Attention]Your not the right level to enter this area", 7)
  Call ReturnPlayer(Index)
  Else
      If GetPlayerLevel(index) < 6 Then
        Call PlayerMsg(index, "welcome to the level 6+ area", 4)
      End If
  End If
End Sub

'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
Sub ReturnPlayer(Index)
'warps player back to previous square
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
Dim Xadd
Dim Yadd

Xadd = 0
Yadd = 0

Select Case GetPlayerDir(Index)
Case 0 ' up
Yadd = -1
Case 1 ' down
Yadd = 1
Case 2 ' left
Xadd = -1
case 3 ' right
Xadd = 1
End select

Call PlayerWarp(Index, GetPlayerMap(Index), Int(GetPlayerX(Index) + Xadd), Int(GetPlayerY(Index) + Yadd))

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

omg supertnx dude!! but i corrected some errors of the code :D
```
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.'
Sub ScriptedTile(index)
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
  Case 0
  If GetPlayerLevel(index) <= 6 Then
  Call PlayerMsg(index, "[Attention]Your not the right level to enter this area", 7)
  Call ReturnPlayer(Index)
  Else
      If GetPlayerLevel(index) > 6 Then
        Call PlayerMsg(index, "welcome to the level 6+ area", 4)
      End If
  End If
End Sub

'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
Sub ReturnPlayer(Index)
'warps player back to previous square
'.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.:!:.
Dim Xadd
Dim Yadd

Xadd = 0
Yadd = 0

Select Case GetPlayerDir(Index)
  Case 0 ' up
      Yadd = 1     
  Case 1 ' down
      Yadd = -1
  Case 2 ' left
      Xadd = 1
  case 3 ' right
      Xadd = -1
End select

Call PlayerWarp(Index, GetPlayerMap(Index), Int(GetPlayerX(Index) + Xadd), Int(GetPlayerY(Index) + Yadd))

End sub
```the symbols <, >, -1,1, were oposite :P and i adde <= to lvl 6
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...