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

Giving the SPEED stat a reason


Diskmaster
 Share

Recommended Posts

Hi, I am trying to make the SPEED stat have a reason so, I am making it so you get faster depending on what lvl in speed u r Here is the script, I just need a proofread, oh, and I have connected these to the Log on sub or whatever:
```
Sub CheckSpeed(index)
If GetPlayerSPEED(Index) > 1999 Then
Call SetPlayerSpeed(index, "Run", 16)
Call SetPlayerSpeed(index, "Walk", 6)
Else
If GetPlayerSPEED(Index) > 1499 Then
Call SetPlayerSpeed(index, "Run", 12)
Call SetPlayerSpeed(index, "Walk", 6)
Else
Call CheckSpeed2(index)
End If
End If
End Sub

Sub CheckSpeed2(index)
If GetPlayerSPEED( Index) > 999 Then
Call SetPlayerSpeed(index, "Run", 10)
Else
If GetPlayerSPEED( Index) > 499 Then
Call SetPlayerSpeed(index, "Run", 9)
Else
Call SetPlayerSpeed(index, "Walk", 4)
Call SetPlayerSpeed(index, "Run", 8)
End If
End If
  End Sub 

```Any Suggestions? I thought it was good!??!
Link to comment
Share on other sites

```
Sub CheckSpeed(index)
    If GetPlayerSPEED(Index) > 1999 Then
        Call SetPlayerSpeed(index, "Run", 16)
        Call SetPlayerSpeed(index, "Walk", 8)
    ElseIf GetPlayerSPEED(Index) > 1499 Then
        Call SetPlayerSpeed(index, "Run", 12)
        Call SetPlayerSpeed(index, "Walk", 6)
    ElseIf GetPlayerSPEED( Index) > 999 Then
        Call SetPlayerSpeed(index, "Run", 10)
        Call SetPlayerSpeed(index, "Walk", 5)
    ElseIf GetPlayerSPEED( Index) > 499 Then
        Call SetPlayerSpeed(index, "Run", 9)
        Call SetPlayerSpeed(index, "Walk", 5)
    Else
        Call SetPlayerSpeed(index, "Run", 8)
        Call SetPlayerSpeed(index, "Walk", 4)
    End If
End Sub

```
Although, I can already see a problem.
The speeds have to be a power of two.
Link to comment
Share on other sites

It is:
```
Call SetSpeed(Index, "Walk", 4)

```Or
```
Call SetSpeed(Index, "Run", 8)

```Except you can replace the numbers, SetPlayerSpeed(Index, "Walk", 8) Is trying to set the player's speed stat to "Walk", and it doesn't know what to do with the comma and the 8 either.
Also, if it doesn't work with setspeed, then that means your client is "Anti-Speedhack"d, making that command useless >.<
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...