Yes. I am aware ProximityPrompts are not s upported in local scripts, ubt I need a local-script only script to work when a prox prompt is triggered. Help, please?
workspace.Chal3.Chaal3.Chale3.ProximityPrompt.Triggered:Connect(function(player)
game.Players.LocalPlayer.PlayerGui.LadderChallenge.LADDERTIMER.GRAAMRDER.Enabled = false
game.Workspace.Passed:Play()
local status = 0
local camera = workspace.CurrentCamera
local rs = game:GetService("RunService")
local angle = 0
local rate = 180 / 2 -- 180 degrees in 2 seconds
rs.RenderStepped:Connect(function()
camera.CFrame = CFrame.lookAt(camera.CFrame.Position, camera.CFrame.Position + camera.CFrame.LookVector) * CFrame.Angles(0, 0, math.rad(angle))
end)
if (status == 0) then
status = 2
while (angle < 180) do
local t = rs.RenderStepped:Wait()
angle = angle + rate * t
end
angle = 180
status = 1
elseif (status == 1) then
status = 2
while (angle > 0) do
local t = rs.RenderStepped:Wait()
angle = angle - rate * t
end
angle = 0
status = 0
end
game.Players.LocalPlayer.PlayerGui.LadderChallenge:Destroy()
game.Workspace.ChallengeIII:Destroy()
end)
Becaus ethe Proximity prompt is not located where you say it is, try placing the script under the proximity Prompt (Script.Parent = ProximityPrompt) and just use script.Parent.Trigrered (The event is not write correctly since I normally press TAB)
It probably don’t work because you didn’t created any variables, and didn’t check if your object are found… that’s also why you got this error.
workspace.Chal3.Chaal3.Chale3 is a proximity prompt, you don’t need to do workspace.Chal3.Chaal3.Chale3.ProximityPrompt.
That’s why the error says “ProximityPrompt is not a valid member of ProximityPrompt”, you’re checking if you can find a proximity prompt in your proximity prompt.
Can you try this into a local script in StarterPlayerScript ?
local Model = workspace:WaitForChild("Chal3", 30)
local ProximityPrompt = Model and Model:FindFirstChildWhichIsA("ProximityPrompt", true)
if ProximityPrompt then
ProximityPrompt.Triggered:Connect(function(player)
print("Triggered:", player.Name)
end)
end