Skillzalot Posted March 3, 2009 Author Share Posted March 3, 2009 I have been working on this script that allows a set of armor if your a warrior to add to your strength and defense if you have it equipped. How would i make it so if you take it off it goes away. Here is the current script script```Sub WarriorSet1()Dim xDim IndexX = 0Index = 1Do While X = 0 If GetPlayerClass(Index) = 1 and GetPlayerArmorSlot(Index) = 51 and GetPlayerLegsSlot(Index) = 52 and GetPlayerHelmetSlot(Index) = 53 and GetPlayerNecklaceSlot(Index) = 54 and GetPlayerRingSlot(Index) = 55 and GetPlayerShieldSlot(Index) = 56 and GetPlayerWeaponSlot(Index) = 57 Then Call PlayerMsg(Index, "You feel the energy of your equipped items, 13) Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 10) Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 10) End If Index = Index + 1 If Index = 100 Then X = 1 End IfLoopEnd Sub```I dont know where i would place that script. Link to comment Share on other sites More sharing options...
cheatking Posted March 3, 2009 Share Posted March 3, 2009 Well by the look of it you should go to an NPC but if you want I can edit it so it checks every second. Link to comment Share on other sites More sharing options...
Skillzalot Posted March 3, 2009 Author Share Posted March 3, 2009 Doing that would be great but showing me how to fix it would be better. Link to comment Share on other sites More sharing options...
Drag0n Posted March 3, 2009 Share Posted March 3, 2009 Hmm.. I think it would go at the bottom, where most miscellaneous scripts go. Link to comment Share on other sites More sharing options...
Skillzalot Posted March 3, 2009 Author Share Posted March 3, 2009 im talking about making it so if you have all those things equipped and your a warrior you get those stats increase. Then when you take one thing off it takes away the stat increase. I also dont know if there is a sub to check equipped items Link to comment Share on other sites More sharing options...
cheatking Posted March 3, 2009 Share Posted March 3, 2009 Yould have to make a script to call it if you want to check it every second you should get rid of the messages Link to comment Share on other sites More sharing options...
Skillzalot Posted March 3, 2009 Author Share Posted March 3, 2009 ok Ill remove the messages if you help me with the rest Link to comment Share on other sites More sharing options...
cheatking Posted March 3, 2009 Share Posted March 3, 2009 ok now instead of having lots of ifs use 'and'```Sub Warrior Set 1 If GetPlayerClass(Index) = 1 and GetPlayerArmorSlot(Index) = 51 Then``` Link to comment Share on other sites More sharing options...
Skillzalot Posted March 3, 2009 Author Share Posted March 3, 2009 ok Link to comment Share on other sites More sharing options...
Skillzalot Posted March 4, 2009 Author Share Posted March 4, 2009 There i changed it can someone please help me get this working Link to comment Share on other sites More sharing options...
cheatking Posted March 4, 2009 Share Posted March 4, 2009 now add Dim Index and Dim X under the subnow this gets confusingadd:```X = 0Do While X = 0' your codeIndex = Index + 1if Index = '( Your max players) thenX = 1End IfLoop``` Link to comment Share on other sites More sharing options...
Skillzalot Posted March 4, 2009 Author Share Posted March 4, 2009 Did I make it right Link to comment Share on other sites More sharing options...
cheatking Posted March 4, 2009 Share Posted March 4, 2009 ```Sub WarriorSet1()Dim xDim IndexX = 0Index = 1Do While X = 0 If GetPlayerClass(Index) = 1 and GetPlayerArmorSlot(Index) = 51 and GetPlayerLegsSlot(Index) = 52 and GetPlayerHelmetSlot(Index) = 53 and GetPlayerNecklaceSlot(Index) = 54 and GetPlayerRingSlot(Index) = 55 and GetPlayerShieldSlot(Index) = 56 and GetPlayerWeaponSlot(Index) = 57 Then Call PlayerMsg(Index, "You feel the energy of your equipped items, 13) Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 10) Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 10) End If Index = Index + 1 If Index = 100 Then X = 1 End IfLoopEnd Sub```Just tidyed it up.Ok now in Sub TimedEventAdd Call WarriorSet1()It should work. Link to comment Share on other sites More sharing options...
Skillzalot Posted March 4, 2009 Author Share Posted March 4, 2009 TY So much Link to comment Share on other sites More sharing options...
cheatking Posted March 4, 2009 Share Posted March 4, 2009 no problem Link to comment Share on other sites More sharing options...
balliztik1 Posted March 5, 2009 Share Posted March 5, 2009 But it doesn't deactivate…You'll need to add a check for if they take the armor off, won't you? Link to comment Share on other sites More sharing options...
Skillzalot Posted March 5, 2009 Author Share Posted March 5, 2009 True. Im a noob can you help me with that Link to comment Share on other sites More sharing options...
cheatking Posted March 5, 2009 Share Posted March 5, 2009 Copy and paste the if so its under the end if.change and to Oradd not before each conditionedit Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 10)so the + is a - Link to comment Share on other sites More sharing options...
Skillzalot Posted March 5, 2009 Author Share Posted March 5, 2009 The way you said that makes no sense to me Link to comment Share on other sites More sharing options...
cheatking Posted March 5, 2009 Share Posted March 5, 2009 ```Sub WarriorSet1() Dim x Dim Index X = 0 Index = 1 Do While X = 0 If GetPlayerClass(Index) = 1 And GetPlayerArmorSlot(Index) = 51 And GetPlayerLegsSlot(Index) = 52 And GetPlayerHelmetSlot(Index) = 53 And GetPlayerNecklaceSlot(Index) = 54 And GetPlayerRingSlot(Index) = 55 And GetPlayerShieldSlot(Index) = 56 And GetPlayerWeaponSlot(Index) = 57 Then Call PlayerMsg(Index, "You feel the energy of your equipped items", 13) Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 10) Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 10) End If If Not GetPlayerArmorSlot(Index) = 51 Or Not GetPlayerLegsSlot(Index) = 52 Or Not GetPlayerHelmetSlot(Index) = 53 Or Not GetPlayerNecklaceSlot(Index) = 54 Or Not GetPlayerRingSlot(Index) = 55 Or Not GetPlayerShieldSlot(Index) = 56 Or Not GetPlayerWeaponSlot(Index) = 57 Then Call PlayerMsg(Index, "You no longer feel the energy of your equipped items", 13) Call SetPlayerSTR(Index, GetPlayerSTR(Index) - 10) Call SetPlayerDEF(Index, GetPlayerDEF(Index) - 10) End If Index = Index + 1 If Index = 100 Then X = 1 End If LoopEnd Sub```did it for you. Link to comment Share on other sites More sharing options...
Skillzalot Posted March 5, 2009 Author Share Posted March 5, 2009 Ty So much. I could not have figure it out Link to comment Share on other sites More sharing options...
balliztik1 Posted March 5, 2009 Share Posted March 5, 2009 Still, though, that doesn't do anything but add or subtract stats. If the check runs again, the player will gain more stats or lose more stats. You need to set a variable for whether or not they have the armor set or not. If the expected outcome is not what's in that saved variable, then produce the opposite result, else nothing happens. Link to comment Share on other sites More sharing options...
Skillzalot Posted March 5, 2009 Author Share Posted March 5, 2009 Can someone help me do thatIm understand the script so far. I know know loops Link to comment Share on other sites More sharing options...
cheatking Posted March 6, 2009 Share Posted March 6, 2009 @[NW:> [CUBE] Sean link=topic=39814.msg389040#msg389040 date=1236268031]> ```> Sub WarriorSet1()> Dim x> Dim Index> X = 0> Index = 1> > Do While X = 0> If GetPlayerClass(Index) = 1 And GetPlayerArmorSlot(Index) = 51 And GetPlayerLegsSlot(Index) = 52 And GetPlayerHelmetSlot(Index) = 53 And GetPlayerNecklaceSlot(Index) = 54 And GetPlayerRingSlot(Index) = 55 And GetPlayerShieldSlot(Index) = 56 And GetPlayerWeaponSlot(Index) = 57 Then> Call PlayerMsg(Index, "You feel the energy of your equipped items", 13)> Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 10)> Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 10)> Call PutVar("\accounts\" & GetPlayername(index), [Armor Boost], Give, 1)> End If> > if GetVar("\accounts\" & GetPlayername(index), [Armor Boost], Give) = 1> If Not GetPlayerArmorSlot(Index) = 51 Or Not GetPlayerLegsSlot(Index) = 52 Or Not GetPlayerHelmetSlot(Index) = 53 Or Not GetPlayerNecklaceSlot(Index) = 54 Or Not GetPlayerRingSlot(Index) = 55 Or Not GetPlayerShieldSlot(Index) = 56 Or Not GetPlayerWeaponSlot(Index) = 57 Then> Call PlayerMsg(Index, "You no longer feel the energy of your equipped items", 13)> Call SetPlayerSTR(Index, GetPlayerSTR(Index) - 10)> Call SetPlayerDEF(Index, GetPlayerDEF(Index) - 10)> End If> End If> > Index = Index + 1> > If Index = 100 Then> X = 1> End If> Loop> End Sub> ```> did it for you.updated Link to comment Share on other sites More sharing options...
Skillzalot Posted March 6, 2009 Author Share Posted March 6, 2009 Thank you. With this ill be able to make armor sets for all my classes. Thank you 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