How do you import GUIs into FE2?

I’ve been looking forward to adding custom text guis to the MMP C2, I know how to MAKE the GUIs, but I have no idea how to import them into FE2 Community Maps for them to be used mid-map, any help?

1 Like

haven’t u done that tho

No, thats from FE2 itself. I’m looking for importing an entirely custom GUI into FE2 CM separately.

oooooh
that’s make sense

make a script which clones every gui into every players PlayerGui

The issue is I don’t know exactly how to do that. I’ve tried quite a bit of ways, but they dont seem to work.

Ok, lets say you have the gui in the map, you can run this code and it should work.

for i,v in pairs(game.Players:GetPlayers()) do
  if (Lib.Map.Spawn.Position - v.Character.Humanoid.RootPart.Position).magnitude <= 50 then
    -- Player is in the map.
    local gui = Lib.Map.GuiNameGoesHere:Clone()
    gui.Parent = v.PlayerGui ~= nil and v.PlayerGui
  end
end

Kris, you’re right, but Crazyblox put to Gui doesn’t work in eventscript or script, so you need put in EventScript or EventString:

--[[ Variables ]]--

local Lib = game:GetService("Workspace").Multiplayer.GetMapVals:Invoke()

--[[ Button Script ]]--

Lib.Button:Connect(function(p, bNo)
	if Lib.btnFuncs[bNo] then
		Lib.btnFuncs[bNo](bNo, p)
	end
end)

--[[ LocalGuiScript Move Script ]]--

for i, v in pairs(game:GetService("Players"):GetPlayers()) do
	if v.Character ~= nil and v.Character:FindFirstChildOfClass("Humanoid") ~= nil and v.Character:FindFirstChildOfClass("Humanoid").Health > 0 and (Lib.Map.Spawn.Position - v.Character.HumanoidRootPart.Position).Magnitude <= 50 and not v.Character:FindFirstChild("LocalGuiScript") then
		spawn(function()
			local LocalGuiScript = Lib.Map.LocalGuiScript:Clone()
			LocalGuiScript.Parent = v.Character
			LocalGuiScript.Disabled = false
		end)
	end
end

And in LocalGuiScript:

--[[ Variables ]]--

local Player = game:GetService("Players").LocalPlayer
local Character = script.Parent
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Map = game:GetService("Workspace").Multiplayer.Map

--[[ Gui Script ]]--

repeat
	game:GetService("RunService").RenderStepped:Wait()
until Player:FindFirstChild("PlayerGui") ~= nil

if not Player.PlayerGui:FindFirstChild("MapGui") then
	local MapGui = Map.Guis.MapGui:Clone()
	MapGui.Parent = Player.PlayerGui
end

Humanoid.Died:Connect(function()
	if Player.PlayerGui:FindFirstChild("MapGui") ~= nil then
		Player.PlayerGui:FindFirstChild("MapGui"):Destroy()
	end
end)

spawn(function()
	Humanoid.Died:Wait()
	if Player.PlayerGui:FindFirstChild("MapGui") ~= nil then
		Player.PlayerGui:FindFirstChild("MapGui"):Destroy()
	end
end)
1 Like

Like this:

bruh ur smart

thanks :stuck_out_tongue:

1 Like

Thank you! If I get around to making the MMP again, I’ll be sure to refer back to this post.

Emphasize on “If”. Long story short, I haven’t been wanting to create to make the Mega Map-Pack as much as before, because I have much bigger passions that I want to pursue. The MMP was the thing that was gonna use this. Hopefully someone will come across this and use your solution to help them instead! But thanks for the information nonetheless.

1 Like

You’re welcome @PinkDosh! ^w^

1 Like