Fatmidget Posted December 3, 2008 Author Share Posted December 3, 2008 Alrighty this should be a fairly basic thing you can help me with… So i set up an item that switches my character to sprite number 5, sprite number 5 is my character with a car, i was wondering what script i would implement on the end to make me turn back from the car to my normal sprite by clicking the item again, thanks!Sub ScriptedItem(index, Script)Select Case Script Case 0Call SetPlayerSprite(Index, 5)Call PlayerMsg(Index, "You Hop in the car.", WHITE)SendPlayerDataEnd SelectEnd Sub(Also i was wondering if there was a feature where i could change my sprites speed, if not thanks anyways) Link to comment Share on other sites More sharing options...
munro Posted December 4, 2008 Share Posted December 4, 2008 Sub ScriptedItem(index, Script)``` Select Case Script Case 0 Call putvar("carform.ini", Sprites, GetPlayerName(index), Getplayersprite(index)) call setplayerspeed(index, GetPlayerSpeed(index)+4) Call SetPlayerSprite(Index, 5) Call PlayerMsg(Index, "You Hop in the car.", WHITE) SendPlayerDataEnd Select End Sub```To switch back just do```Call SetPlayerSprite(Index, putvar("carform.ini", Sprites, GetPlayerName(index))) Call PlayerMsg(Index, "You get out of the car", WHITE) SendPlayerData```something like this. I didn't test it or even read it through. Any problems tell me. Link to comment Share on other sites More sharing options...
DarkMazer Posted December 4, 2008 Share Posted December 4, 2008 @Munro:> Sub ScriptedItem(index, Script)> > > Select Case Script> > Case 0> > Call putvar("carform.ini", Sprites, GetPlayerName(index), Getplayersprite(index))> > call setplayerspeed(index, GetPlayerSpeed(index)*2)> > Call SetPlayerSprite(Index, 5)> > Call PlayerMsg(Index, "You Hop in the car.", WHITE)> > SendPlayerData> > End Select> > End Sub> > To switch back just do> > > Call SetPlayerSprite(Index, getvar("carform.ini", Sprites, GetPlayerName(index)))> > Call PlayerMsg(Index, "You get out of the car", WHITE)> > call setplayerspeed(index, GetPlayerSpeed(index)/2)> > SendPlayerData> > something like this. I didn't test it or even read it through. Any problems tell me.I see a few problems, but I fixed them above. The changes are underlined. Link to comment Share on other sites More sharing options...
munro Posted December 5, 2008 Share Posted December 5, 2008 @DarkMazer:> To switch back just do> > something like this. I didn't test it or even read it through. Any problems tell me.> > I see a few problems, but I fixed them above. The changes are underlined.No problems you just multiplied the speed instead of adding which I did. And you divided the speed afterwards which I admit I forgot to add.But don't call them mistakes if all you did was add your own spin. Link to comment Share on other sites More sharing options...
DarkMazer Posted December 5, 2008 Share Posted December 5, 2008 I only called that a problem because, if the player's speed is already higher than 4, it won't work, since SetSpeed only takes in powers of 2. Oh, I just noticed that you used SetPlayerSpeed and not SetSpeed. XPThe main thing I was correcting was using putvar in a place where getvar should have been. Link to comment Share on other sites More sharing options...
Fatmidget Posted December 6, 2008 Author Share Posted December 6, 2008 This doesnt work… Wont even say you hop in the car... I probably installed it incorrectly or something... Also how do i install the second part Link to comment Share on other sites More sharing options...
Fatmidget Posted December 6, 2008 Author Share Posted December 6, 2008 nvm i think i did it Link to comment Share on other sites More sharing options...
Fatmidget Posted December 6, 2008 Author Share Posted December 6, 2008 Nope still doesnt work lol, Whenever i add that thing at the top the putvar or w/e it doesnt work… lol 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