Jump to content
GTkoi

Change map when key pressed

Recommended Posts

Hello ,I would like a code to change the map when I press a key . Also I have delete "triggerChangeMap" for my pc and how do I do to have it again ?

Thanks you 😁😁

Share this post


Link to post

I would try something like:

function Script:UpdateWorld()
If window:KeyHit(Key.A) then

  changemapname=self.mapname

end


Here's the triggerChangeMap script.

--[[
This script will act as a trigger to change the current map.
Place this at the end of your map to make the player progress
to the next level.
]]--

Script.mapname=""--string "Map Name"

function Script:Start()
    self.enabled=true
end

function Script:Collision(entity, position, normal, speed)
    changemapname=self.mapname
end

function Script:Enable()--in
    if self.enabled==false then
        self.enabled=true
        self:CallOutputs("Enable")
    end
end

function Script:Disable()--in
    if self.enabled then
        self.enabled=false
        self:CallOutputs("Disable")
    end
end

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...