I already created a map system wich is working perfect, but it aways displaying on screen and i dont want that…
I want the map to only appear when I press the Letter M on the keyboard
So, here is my code on StarterGui
-- Variables
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local MapFolder = game.Workspace:FindFirstChild("MapFolder")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Frame = script.Parent.MapFrame
local PlayerArrow = Frame.PlayerArrow
local Camera = Instance.new("Camera", game.Workspace)
Camera.CameraType = Enum.CameraType.Scriptable
Frame.CurrentCamera = Camera
Camera.FieldOfView = 4
for i, Objects in pairs(MapFolder:GetChildren()) do
local Clone = Objects:Clone()
Clone.Parent = Frame
end
RunService.RenderStepped:Connect(function()
Camera.CFrame = CFrame.new(HumanoidRootPart.Position + Vector3.new(0,3000,0), HumanoidRootPart.Position)
PlayerArrow.Rotation = -HumanoidRootPart.Orientation.Y - 90
end)