Hi there, so I've got this script that spawns a GUI on click, and needs to work with FE. But I tried simply putting the GUI into StarterGUI, and that doesn't work with FE. Could anyone please help me make this script work as a GUI Button? Note: IT NEEDS TO USE THE GUIGIVE EVENT!
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
game.ReplicatedStorage.GuiGive:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent),game.ReplicatedStorage,script.Name)
end
end)
ServerScript that is needed to equip the gear!
local g,flash
function Assign(p, Value, Type)
local Player=p.Character
if Type=="Uniform Change"or Type=="Uniform Gear Change"or Type=="Gear" then
if p.PlayerGui:FindFirstChild("Uniform Change") or p.PlayerGui:FindFirstChild("Uniform Gear Change") or p.PlayerGui:FindFirstChild("Gear")then return end
Value[Type]:Clone().Parent=p.PlayerGui
end
if Type=="Shirt" or Type=="Pants" then
local pID = Value:findFirstChild("ID") -- Location of the ID Value
local ID = pID.Value -- Value of ID
local baseID = "rbxassetid://"
local thing=Instance.new(Type)
if Player:findFirstChild(Type) == nil then
if Type=="Shirt" then thing.ShirtTemplate=baseID..tostring(ID-1) elseif Type=="Pants" then thing.PantsTemplate=baseID..tostring(ID-1)end
thing.Parent=Player
thing.Name = Type
else
if Type=="Shirt" then thing.ShirtTemplate=baseID..tostring(ID-1) elseif Type=="Pants" then thing.PantsTemplate=baseID..tostring(ID-1)end
thing.Parent = Player
local t = Player:findFirstChild(Type)
t:remove()
thing.Name = Type
end
end
if Player:findFirstChild("Humanoid") and (Type=="Gear" and not Player:findFirstChild("Gear")) or (Type=="Hat" and not Player:findFirstChild("Face")) then
if Type=="Hat" then g=Value:FindFirstChild("Face"):Clone() elseif Type=="Gear" then g=Value:FindFirstChild("Gear"):Clone() end
g.Parent = Player
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "Part" or "Unionoperation" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
g.Middle.Transparency = 1
end
local Y = Instance.new("Weld")
if Type=="Hat" then Y.Part0 = Player.Head elseif Type=="Gear" then Y.Part0 = Player.Torso end
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
if Type=="Hat" then flash=Value:FindFirstChild("RemoveH"):Clone() elseif Type=="Gear" then flash=Value:FindFirstChild("RemoveG"):Clone() end
if Type=="Hat" then flash.Frame.RH.Hat.Disabled=false elseif Type=="Gear" then flash.Frame.RG.Gear.Disabled=false end
flash.Parent = p.PlayerGui
end
end
function game.ReplicatedStorage.Order.OnServerInvoke(p,val,typ)
Assign(p,val,typ)
end

3 comments
It needs a click detector.
@himgoodpack I don't want it to be inside a part, I want this to be INSIDE my GUI's button.
If you put something in StarterGUI, players will only see it after they respawn.