Hello,
What I want to achieve is that when a player triggers a ProximityPrompt, it will check if the player is sitting, and if yes, it will return the seat in which the player is.
Currently, my script is that :
local ProximityPromptService = game:GetService("ProximityPromptService")
local function onPromptTriggered(promptObject, player)
if promptObject.Parent.Name == "ThatPart" then
if player.Character.Humanoid.Sit == true then
local CurrentSeat -- Here I need to get the seat the player is in
if CurrentSeat.Parent.Name == "TheThingIwant" then
-- Do Things
end
end
end
end
ProximityPromptService.PromptTriggered:Connect(onPromptTriggered)
If you know how to do this or there is a existing topic that can help, please tell me !