ryandoo Posted October 23, 2010 Author Share Posted October 23, 2010 Hello, ive been trying to make a script to make a scripted tile that changes a certain sprite at a certain level. How can i get the following script to work?If sprite 1 Then (Index, If True Then If Level > 19 Change to Sprite 2) If False Call PlayerMsg (Index, Your not the right level!" RED)End IfThanks for your help. Link to comment Share on other sites More sharing options...
Athagekin Posted October 23, 2010 Share Posted October 23, 2010 I'm going to guess you're new to SadScript, yes? Anyways, the syntax is trash, so this would never work. Here's the right way:```Sub ChangeSprite(Index)If GetPlayerLevel(Index) >= # Then Call SetPlayerSprite(Index, #) ElseIf GetPlayerLevel(Index) <= # Then Call PlayerMsg(Index, "You're not the right level!", RED) End If End Sub```The # is the level that you want to put.Don't worry, we all started out like you at some point. With a little practice, you'll get better. ;) Link to comment Share on other sites More sharing options...
ryandoo Posted October 23, 2010 Author Share Posted October 23, 2010 @Athagekin:> I'm going to guess you're new to SadScript, yes? Anyways, the syntax is trash, so this would never work. Here's the right way:> > ```> Sub ChangeSprite(Index)> > If GetPlayerLevel(Index) >= # Then> Call SetPlayerSprite(Index, #)> ElseIf GetPlayerLevel(Index) <= # Then> Call PlayerMsg(Index, "You're not the right level!", RED)> > End If> End Sub> ```> The # is the level that you want to put.> > Don't worry, we all started out like you at some point. With a little practice, you'll get better. ;)this didnt work :( Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2010 Share Posted October 23, 2010 Because you need to change "$" to the number you want. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now