I had attempted to make a Message script that only a Specific player can see, but the Output said 'PlayerGui is not a vaild member of Player', what happened? ;-;
Here is the script;
fucntion oc(msg,time,type,par) m=Instance.new(type) m.Parent=par m.Text=msg wait(time) if m~=nil then m:remove() end end oc("Welcome to the game.",4,"Hint",game:GetService("Players").LocalPlayer.PlayerGui)
-- ANSWER -- I found out what the problem was, FilteringEnabled was keeping me from using PlayerGui. o_e
Well I am assuming that the function is firing before the PlayerGui is instantiated. So just add
repeat wait() until game:GetService("Players").LocalPlayer.PlayerGui;
(You mispelled function by the way)
This is happening because the script is probably running before the PlayerGui is created, so it doesn't exist!
All Objects inherit a WaitForChild
method, which waits for a child with the given name. It also returns that child when it is found.
On the last line, replace game:GetService("Players").LocalPlayer.PlayerGui
with:
GetService("Players").LocalPlayer:WaitForChild("PlayerGui")