I have a script that opens a dialogue GUI upon activating a ProximityPrompt.
I tried to modify the script so that it would work when touching a part.
I realized that my problem is that plr is getting it’s properties from the part, and not the LocalPlayer anymore. If there’s a way to make it where touching the part will get the LocalPlayer’s PlayerGUI please let me know.
local say = {"This door is locked."}
local debounce = false
script.Parent.Touched:Connect(function(plr)
if debounce == false then
debounce = true
script.Parent.Interact:play()
wait(.125)
plr.PlayerGui.TextUI.Background.Nameplate.Tag.Text = " "
plr.PlayerGui.TextUI.Enabled = true
plr.PlayerGui.TextUI.Enabled = true
for i, v in pairs(say) do
for i = 1, string.len(v) do
wait(0.05)
script.Parent.HenryVoice:play()
plr.PlayerGui.TextUI.Background.Dialogue.Text = string.sub(v, 1, i)
end
wait(string.len(v) / 25)
end
plr.PlayerGui.TextUI.Enabled = false
debounce = false
end
end)