Jump to content

Just another messed up attempt at scripting


Recommended Posts

A few weeks back, i created a topic asking about how to get the player to teleport to a location via scripting, and after much hardship, i finally got it... kinda...

 

scriptname ACPlayerteletoarena

 

;Quest script applied to quest ACArenaChallengeQuest

 

short acplayerteletoa

short DoOnce

 

begin gamemode

(Tab) if ACplayerteletoa == 1 && DoOnce == 0

(Tab)(Tab) player.moveto ACTargetRatmid

(Tab)(Tab) set DoOnce to 1

(Tab)(Tab) set ACplayerteletoa to 0

(Tab)(Tab) setstage ACArenaChallengeQuest 10

(Tab)(Tab) set acarenachallengequest.ACPlayerteletoa to 0

(Tab) endif

end

 

 

within my quest that this script is attached to, i have dialogue so that when you say "yes", it executes the script, and it does all that fine, but for some messed up reason that i have yet to figure out, it will continually teleport my player back to ACTargetRatmid about every 2 seconds...

 

 

And yes, i tried setting the script to kill the rat, but that doesn't seem to be too happy with the quest type scripts, cause it gave me an error, and wouldn't let me save it...

 

anyone have any suggestions as to why this may be happening?

 

Any insight would be greatly appreciated, thanks in advance.

Edited by GODSBANE123456
Link to comment
Share on other sites

The problem is due to the issue where any movement called on the player acts as a Return in the script, preventing all other functions after it from happening. Essentially, just moving the Move function after all other actions are done should fix it.

 

scriptname ACPlayerteletoarena

;Quest script applied to quest ACArenaChallengeQuest

short acplayerteletoa
short DoOnce

begin gamemode
(Tab) if ACplayerteletoa == 1 && DoOnce == 0
(Tab)(Tab) set DoOnce to 1
(Tab)(Tab) set ACplayerteletoa to 0
(Tab)(Tab) setstage ACArenaChallengeQuest 10
(Tab)(Tab) set acarenachallengequest.ACPlayerteletoa to 0
(Tab)(Tab) player.moveto ACTargetRatmid
(Tab) endif
end

Link to comment
Share on other sites

Oh my god wow that worked thanks a lot, although now when i click yes, it takes a second to initiate the loading screen, but atleast it works, now i can move forward on my attempt to create a good first modhttp://www.thenexusforums.com/public/style_emoticons/dark/biggrin.gif
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...