So basically, I am working on reconstructing an open source mini games game by completely upgrading it to a more modern roblox style of playing. Right now I am trying to switch all of the game messages (ex: Next mini game starting in...) from a black hint at the top of the screen to a Screen Gui in the PlayerGui. I need someone to point out my mistake in this code because it is not working properly.
function displayMSG(string, parent, time)
local msg = game.PlayerGui.Text.TextBG.Text
msg.Parent.Parent.Parent.Parent = parent
msg.Text = string
wait(time)
msg:remove()
end
function displayHINT(string, parent, time)
local msg = game.PlayerGui.Text.TextBG.Text
msg.Parent.Parent.Parent.Parent = parent
msg.Text = string
if time ~= nil then
wait(time)
msg:remove()
end
end
I know for sure that the code isn't written properly, so any help would be great! Thanks!

2 comments
You never called your functions.
make sure you loop through every player too