写点什么

roblox mini map

用户头像
katichar
关注
发布于: 2020 年 12 月 10 日

local screenGui = script.Parent

local minimapFrame = screenGui:WaitForChild("Minimap")

local localplayer = minimapFrame:WaitForChild("LocalPlayerLocation")

local VehicleLocation = minimapFrame:WaitForChild("VehicleLocation")

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()


local hrp = char:WaitForChild("HumanoidRootPart")

local humanoid = char:WaitForChild("Humanoid")


local currentCamera = Instance.new("Camera")

currentCamera.FieldOfView = 1

currentCamera.CameraType = Enum.CameraType.Scriptable

currentCamera.Parent = workspace


minimapFrame.CurrentCamera = currentCamera

local playerobjflag = workspace.red:Clone()

playerobjflag.Parent = minimapFrame

for i,minimapobj in pairs(workspace.map:GetChildren()) do

minimapobj:Clone().Parent = minimapFrame


end


local flags={}

game:GetService("RunService").RenderStepped:Connect(function()

local camCFrame = CFrame.new(hrp.Position + Vector3.new(0,9000,0),hrp.Position)

currentCamera.CFrame = camCFrame

localplayer.Rotation = -hrp.Orientation.Y - 90

for _,v in pairs(game.Players:GetChildren()) do

if v.UserId ~= plr.UserId then

local char = v.Character or v.CharacterAdded:Wait()


local hrp1 = char:WaitForChild("HumanoidRootPart")

if not flags[v.UserId] then

flags[v.UserId] = VehicleLocation:Clone()

flags[v.UserId].Parent = minimapFrame

flags[v.UserId].Visible = true

end

local angle = math.atan2(hrp1.CFrame.lookVector.x, hrp1.CFrame.lookVector.z)


local degrees = math.ceil(math.abs(math.deg(angle)-180))

--VehicleLocation.Position = UDim2.new(0,hrp.Position.X/512,0,hrp.Position.Y/512)

--playerobjflag.Position = Vector3.new(hrp.Position.X,0,0)

local basePos = workspace.Baseplate.Position

local baseSize = workspace.Baseplate.Size

local playerPos = hrp1.Position

local position = ((playerPos - hrp.Position)/1)*2

local v2_position = Vector2.new(position.x, position.z)


--local radar = script.Parent

--local Ppos = radar.Frame


flags[v.UserId].Rotation = degrees

flags[v.UserId].Position = UDim2.new(0.5, (v2position.x), 0.5, (v2position.y))

end


end

end)


发布于: 2020 年 12 月 10 日阅读数: 35
用户头像

katichar

关注

Just Do It!!! 2019.04.09 加入

Just Do It!!!

评论

发布
暂无评论
roblox mini map