````I've tried my old scripting but it doesn't work, I think they updated the coding in Roblox.~~~~~~~~~~~~~~~~~
local msgText = "You need a key to continue." script.Parent.Touched:connect(function(hit) local findhum = hit.Parent:FindFirstChild("Humanoid") if findhum then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local findm = player.PlayerGui:findFirstChild("msg") if not findm then local msg = Instance.new("Message", player.PlayerGui) msg.Text = msgText msg.Name = "msg" wait(5) msg:remove() end end end)
It works, the message will display. You just forgot the part at the bottom. This might fix it!
local msgText = "You need a key to continue." script.Parent.Touched:connect(function(hit) local findhum = hit.Parent:FindFirstChild("Humanoid") if findhum then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local findm = player.PlayerGui:findFirstChild("msg") if not findm then local msg = Instance.new("Message", player.PlayerGui) msg.Text = msgText msg.Name = "msg" wait(5) msg:remove() end end end script.Parent.Touched:connect(onTouch)
Let me know if it doesn't work.
Your problem is most likely this
player.PlayerGui:findFirstChild("msg")
Find must be capitalized for this to work. If it doesn't then post the error you are getting in the output.