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

What's Wrong?


Squiddle
 Share

Recommended Posts

Hi everyone. I'm having difficulties with my recent script. You see, I have a script which would reply "Open" if a certain variable is 1, or "Closed" if it's 0\. I can't seem to find the problem with it though, as when I click the button I get "Type Mismatch: String"

Here's my code:
```
If Clicked_Index = 21 Then
    If GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 0 Then
        Call PlayerMsg(Index, "Open", GREEN)
    ElseIf GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 1 Then
        Call PlayerMsg(Index, "Closed", GREEN)
    End If
End If
```

And this is my Minigames.ini located directly inside the Server\Scripts folder:
```
[SLYMEHUNTER]
Game1Used=0
Game1Timer=0
```
Link to comment
Share on other sites

Like this?
```
If Clicked_Index = 21 Then
    If GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 0 Then
        Call PlayerMsg(Index, "Open", GREEN)
    Else
        Call PlayerMsg(Index, "Closed", GREEN)
    End If
End If
```
Because that's still giving me errors.
Link to comment
Share on other sites

try this
```
Dim Slymehunter
      Slymehunter = GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used")
            If Clicked_Index = 21 and Slymehunter = 0 Then
                Call PlayerMsg(Index, "Open", GREEN)
            Else
                Call PlayerMsg(Index, "Closed", GREEN)
            End If

```
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...