Proximity prompt cant print player

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want my player to load animation
  2. What is the issue? Include screenshots / videos if possible!
    It can’t find player, even though logically it should
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yes I did
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- local service = game:GetService("ProximityPromptService")
local Balcony_Model = workspace.Balcony_Model
local Window = Balcony_Model.Open_window
local prox = Window.ProximityPrompt
local Window = workspace.Window_frame



prox.Triggered:Connect(function(playerWho)
	print(playerWho)
	local pos = CFrame.new(64.075, 5.315, -113.55)
	Window:PivotTo(pos * CFrame.Angles(math.rad(0),math.rad(0),math.rad(32.102)))
	print(playerWho)
end)

It’s a script,non local

4 Likes

PlayerWho is an player object, not the name.

print(playerWho.Name) should work

2 Likes

it should still peint the object. if you were to click on it in the console, it would select the object.

1 Like

prox.Triggered:Connect(function(playerWho)
print(playerWho.Name)
local pos = CFrame.new(64.075, 5.315, -113.55)
Window:PivotTo(pos * CFrame.Angles(math.rad(0),math.rad(0),math.rad(32.102)))
print(playerWho.Name)
end)

doesn’t work, and even if it worked it would have printed plr object

have you made sure the event actually fires? You could print some dummy text like print("fired"), is the output saying anything related to it?

  1. are you sure this is a server script and not a localscript
  2. is there any errors in the console when you trigger the prompt

Inside the event it doesn’t even print (“fired”)

That’s already being done by their print script. It should print something whether there’s an error, nothing there, or a player object.

1 Like

Is your Prompt enabled? Check your properties.

Yes it’s a server script and for as I know nothing prints

It’s prolly enabled since the window moves, that’s all

Why do you have function in that line?

That should be the first lead, it is not referencing the proximity prompt correctly, thus not running any of the code inside the function.

But as he just said, the window moves.

Oops, didn’t read that later reply, my bad.

prox.PromptButtonHoldEnded:Connect(function()
print(“kkkk”)
end)

and it prints nothing is the event not firing?

It is not, check everything is referencing the right ProximityPrompt

1 Like

image
local prox = script.Parent.ProximityPrompt
local Window = workspace.Window_frame

–[[
local pos = CFrame.new(64.075, 5.315, -113.55)
Window:PivotTo(pos * CFrame.Angles(math.rad(0),math.rad(0),math.rad(32.102)))

–]]

prox.PromptButtonHoldEnded:Connect(function()
print(“kkkk”)
end)

ah the prompt was right, but it seems it is another window its soo tricky, anyways I found the solution thanks for your comment

1 Like

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