My Frame Doesn't Show

Hi Everyone, This Is A Report From @WeatheredBlox or my other account…

So I Make NPC Talking Before the frame show up to visible, And the problem is when I Use PlayerAdded and inside of them Is A game.Chat, Are PlayerService Cannot Executing With Other Service Like ChatService?

Here Is My Code

local Head = script.Parent -- Literally The Script Inside The Head Of NPC
local Chat = game:GetService("Chat")

game.Player.PlayerAdded:Connect(function(Player) -- I Use This For Get The Frame Visibility
    Chat:Chat(Head, "What Does This Button Will Do??", Enum.ChatColor.White)
    local Frame = Player.PlayerGui.ScreenGui.Frame
    wait(4)
    Frame.Visible = true
end)

And Then, I Get… Nothing.

RebornCoke

4 Likes

Sorry If My Topic Really Confusing, Because Im Indonesia

1 Like

You can only change the player gui from a local script

This will make a chat message appear above the head when a player enters the game.

Since they are entering the game, you should go ahead and wait for them to load in before trying to make changes to their Gui. A way you can do this is by waiting for a specific object.

local Frame = Player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui",60):WaitForChild("Frame",60)

Other than that, I don’t see anything particularly wrong. Can you clarify your issue?

This is incorrect. It would be a serious pain if you couldn’t manage UI from the server.

like this?

local Player = game:GetService("Players")
local Head = script.Parent
local Frame = Player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui",60):WaitForChild("Frame",60)
local Chat = game:GetService("Chat")

wait(4)
Chat:Chat(Head, "What Does This Button Do?? Can You Help What Is This Button??", Enum.ChatColor.White)
wait(3)
Frame.Visible = true

Nope, UIs can only be accessed from the player. The way that it is commonly done is through remote events and local scripts

my problem at script, not local script

Your problem IS that it is a server script. It needs to be from a local script

i make the script inside NPC Head to make the chat sending trought head, not server

edit: i write “script” instead “code”

1 Like

game.Player does not exist. Use game.Players instead

2 Likes
local Head = script.Parent -- Literally The Script Inside The Head Of NPC
local Chat = game:GetService("Chat")

game.Players.PlayerAdded:Connect(function(Player)
    Chat:Chat(Head, "What Does This Button Will Do??", Enum.ChatColor.White)
   local Frame = Player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui",60):WaitForChild("Frame",60)
    wait(4)
    Frame.Visible = true
end)

I know, i wrong at writing code