I am putting a Message in a players PlayerGui so only they see it when they touch the part...
I think in some way, I need to use GetPlayerFromCharacter but i'm not sure how to use this with using Instance.new so here is my script (Not Local)
SP = script.Parent
SPP = script.Parent.Parent
Debounce = false
SP.Touched:connect(function(hit)
local Human_Check = hit.Parent:FindFirstChild("Humanoid")
if SPP.Enable.Value == false then
SP.Transparency = 0.5
wait(0.1)
SP.Transparency = 0
local msg = Instance.new("Message"), game.Players.GetPlayerFromCharacter.PlayerGui
msg.Text = "Please wait a few seconds and try again"
wait(3)
msg:remove()
end
end)
I would like a little lesson on arguments - in the Object Browser and example is GetPlayerFromCharacter(character), the (character) confuses me a bit- if possible. This script is not finishes, so please do not add in my Debounce. Enable is a BooleanValue which is getting activated by another part.

1 comment
line 11 should be the problem