I am trying to create a clipboard that allows you to type in text and send it via a webhook. However, I ran into a problem when I was not able to manipulate the SurfaceGui on the tool. Despite the SurfaceGui being in the PlayerGui, neither TextButtons nor TextBoxes could be pressed / edited.
Here is the code below:
-- [ Objects ] --
local tool = script.Parent
local holdingAnim = script.HoldingAnim
local paper = tool.Paper
local surfaceGui = paper.ClipboardGui
-- [ Functions ] --
tool.Equipped:Connect(function()
local character = tool.Parent
humanoid = character:FindFirstChild("Humanoid")
local plr = game.Players:GetPlayerFromCharacter(character)
surfaceGui.Parent = plr.PlayerGui; surfaceGui.Enabled = true
local anim = humanoid:LoadAnimation(holdingAnim)
anim:Play()
end)
tool.Unequipped:Connect(function()
surfaceGui.Parent = paper; surfaceGui.Enabled = false
for _, a in pairs (humanoid:GetPlayingAnimationTracks()) do
a:Stop()
end
end)
I hope this is not a bug, because it would ruin my entire project. ![]()