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

Problem with a Popup GUI with a NPC? #NPCPopUp

Asked by 6 years ago
Edited 6 years ago

I've been trying to create a NPC Chat System. My idea is that i want a npc inside a block. And, when you touch the block a Frame pops up with text. How would i do that i've tried this

local Part = script.Parent
local Frame = game.StarterGui.IntelC1

    Part.Touched:connect(function(HIT)
        local H = HIT.Parent:FindFirstChild("Humanoid")
        if H then
            local Player = game.Players:GetPlayerFromCharacter(HIT.Parent)
           Frame.Parent = game.Player.PlayerGui 
           Player.PlayerGui.IntelC1.CHFrame.Visible = true
    end end)

But, i got this error "18:30:45.343 - Player is not a valid member of DataModel" Could anyone help? :) Thanks in advance. Got a new error.

2
Player.PlayerGui, not game.Players.PlayerGui. The PlayerGui is in the Player object itself, not the Players service. User#19524 175 — 6y
0
Thank you! :) This should fix it. Add that to the "Answer this question" box too! :D bobatmcdownalds -2 — 6y
0
that didn't work. Updated the thread. bobatmcdownalds -2 — 6y
0
Kinda like what incapaz said, on line 8 it’s “Player.PlayerGui” not “game.Player.PlayerGui”. User#20279 0 — 6y
0
That worked Denny! :D Thank you soooooooo much! :D bobatmcdownalds -2 — 6y

Answer this question