I'm trying to make it so when a player touches a part one of their gui's get enabled, but i keep getting an error saying 'PromptGui is not a valid member of PlayerGui' on line 11 of the script below:
local border = script.Parent
border.Touched:Connect(function(part)
local humanoid = part.Parent:WaitForChild("Humanoid", 2)
print("Border Touched")
if humanoid then
print("there is humanoid")
local playerName = humanoid.Parent.Name
local player = game.Players:WaitForChild(""..playerName, 2)
if player then
print("there is player")
local promptGui = player.PlayerGui.PromptGui
if promptGui then
print("there is prompt gui")
promptGui.Frame.EnterPosition.Value = CFrame.new(77.405, -52.193, -207.59)
promptGui.Frame.ExitPosition.Value = CFrame.new(68.5, 5.445, -245.5)
promptGui.Enabled = true
print("Prompted")
else
print("prompt gui not found")
end
else
print("player not found")
end
else
print("humanoid not found")
end
end)
Screenshot of output, explorer, and script

1 comment
thank you so much i was so confused