How would i know which player pressed the button?

iam trying to make a code that shows the guı through the script below only to the person who pressed the button to talk to my npc it doesnt work as a local script for some reason id be really glad for any help that i get
thanks in advance

local triggerpart = game.Workspace.eternaldiologue.ProximityPrompt

triggerpart.Triggered:Connect(function()
	triggerpart.Enabled = false
	script.Parent.Visible = true
	script.Parent.Text = "hey there welcome to my game iam still working on this so please be patient while i try my best "
	wait(5)
	script.Parent.Text = "btw if you are rok tell me if you want this code"
	wait(5)
	script.Parent.Text = "aight got to go work right now so see you later"
	wait(3)
	script.Parent.Visible = false
	triggerpart.Enabled = true
end)

ProximityPrompt.Triggered has a playerWhoTriggered parameter:

prompt.Triggered:Connect(function(player)
	print(player.Name)
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.