Jump to content

Looking to make some sort of reload script


killbot5555678
 Share

Recommended Posts

Hello i was working on my game and ran into something i desired i wanted the ability to reload the map i was on (their are many maps!) i found a couple times i got stuck and couldn't fix the problem so my only option was to end game and restart (which mean't i had to start from lvl 1) which was really annoying so what im looking to do is key bind a key like R for instance so when it is pressed it will only reload that map that my player is on along side with everything in it (motors,pivots) it doesn't have to be complex or anything just wanted a simple way to reload one specific map that the player was on thanks

(PS): Not overly savvy with this so please explain well i wish to learn how key binding works cause clearly i haven't figured it out lol along side output calling XD

Link to comment
Share on other sites

  • 6 months later...
On 1/15/2017 at 5:25 AM, Genebris said:

Remember last map you loaded into a variable or have a script on the map that tells you which one it is then this into UpdateWorld:

 

 



 

if window:KeyHit(Key.R) then

World:GetCurrent():Clear()

Map:Load("maps/"..self.map..".map")

end

 

how would i express which map the player is on so he may reload it (post is a little old sorry) 

Link to comment
Share on other sites

im not even completely sure where i should be placing said variable :blink: any chance you could show an example of this? id like to build on the idea itself so id like a throe understanding if its no bother what ive gotten so far is how to bind a key so that that key will load that specific map 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...