Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Text Button in Billboard Gui not working?

Asked by 5 years ago

Im making a game and I want the users to walk up to characters end a billboard gui will appear telling them to press E. However I want to make this functional with touch but for some reason it's not registering the touch. Here is the code below

01for _,npc in pairs(NPCS:GetChildren()) do
02        npc.UpperTorso.EToGift.Frame.TextButton.MouseButton1Click:Connect(function()
03            if Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") then
04                for _, npc in pairs(NPCS:GetChildren()) do
05                    if (npc.HumanoidRootPart.Position - Player.Character.HumanoidRootPart.Position).magnitude < 15 then
06                        if npc.Enabled.Value and Player.OtherInfo.Backpack.Value > 0 then
07                            game.Workspace.Events.DisableNPC:FireServer(npc)
08                        end
09                    end
10                end
11            end
12        end)
13    end

Answer this question