Client to Server Proximity prompt

I NEED IT TO BE DONE FAST CUZ PEOPLE ARE WAITING FOR THE UPDATE :cold_sweat:
Ask me for more info cuz idk what you guys need
CLIENT: I tweened a Part that has a proximity prompt attached to it
SERVER: teleports player to vector3 when proximity prompt is triggered
for some reason the server doesnt get the proximity prompt being triggered :frowning:
SERVER SCRIPT

script.Parent.Triggered:Connect(function(plr)
    plr.Character.PrimaryPart.Position = Vector3.new(0,30,0)
end)

CLIENT SCRIPT

local Prompt = script.Parent --THIS IS AN OTHER PROMPT NOT THE SAME AS THE SERVER ONE
local UpA = script.Parent.Parent.Parent.up.a
local UpB = script.Parent.Parent.Parent.up.Part
local DoA = script.Parent.Parent.Parent.down.a
local DoB = script.Parent.Parent.Parent.down.Part

Prompt.Triggered:Connect(function(player)
	Prompt.Enabled = false
	UpA.Transparency = 1--Λ‡
	UpB.Transparency = 1--Λ‡
	DoA.Transparency = 0--Λ‡
	DoB.Transparency = 0--ignore these dob and upa things its a lever getting pulled
	local Tween = game:GetService("TweenService"):Create(workspace["000 AREAS"]["Area-C"].base,TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{CFrame = CFrame.new(Vector3.new(16.229, -11.5+30, 414.026)) * CFrame.fromEulerAnglesXYZ(0, -115, -0) })
	--   workspace["000 AREAS"]["Area-C"].base   has the proximity prompt in it
	wait(1)
	Tween:Play()
	workspace["000 AREAS"]["Area-C"]["?"].secret:Play()
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	local x = 0
	while wait(0.1) do
		x += 1
		workspace.CurrentCamera.CFrame = workspace["DETECTIVE"].focus1.CFrame
		if x >= 50 then
			workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
			break
		end
	end
end)
script.Parent.Triggered:Connect(function(plr)
	plr.Character:WaitForChild("HumanoidRootPart").Position = Vector3.new(0,30,0)
end)

the problem is script.Parent.Triggered doesnt fire. it finds the HRP in a localscript tho

1 Like

Based on my experience, ProximityPrompt only trigger in normal script. Use remote event to parse the information.

tried that, but that didnt work

but does the player character has the same pos on server and on client too? cuz then its solved
cuz i can move the player in a client script

1 Like

It truly depend. Some client can spoof their character body part using CFrame manipulation.

No, because the server will never know what the client is doing, do the teleport on server based instead.

it worked tho :flushed: i cant believe i wasted 1.5 hours :sob::skull:

1 Like

Glad you solved ya own problem! :grin:
You might wanna do some sanity check too!

2 Likes

im not english so…
what does that mean? :sweat_smile:

1 Like

Verify the player position and other stuff. In short, do some security check like Magnitude checker.

For example, there is an exploit script that can trigger an ProximityPrompt / MouseClickDetector / Touched from far away.

i hope it means that.

my english β†’ hungarian dictionary said it means some another thing… :face_with_raised_eyebrow: :joy:

1 Like

thought you were trying to say he was going insane lol.

2 Likes

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