Hello, sometime ago some folks of Devforum helped me with making a script to hide proximity prompts only for the player sitting on the vehicle, which shouldnt be hard, but yea its hard and you need 3 degrees to do that lol
It is partially working but the bug is, you are sitting on the driver seat for example, then a passanger enters on your side, then he leaves the car, the proximity prompt will appear on that seat while you driving, making it hard to leave the vehicle without changing seats and its visually bad.
heres the server script
local storage = game:WaitForChild("ReplicatedStorage")
local players = game:GetService("Players")
local event = storage:WaitForChild("ProximityPrompts")
local formerPlayer = {}
for _, seat in pairs(workspace.Vehicles:GetDescendants()) do
if seat:IsA("Seat") or seat:IsA("VehicleSeat") then
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local player = seat.Occupant and players:GetPlayerFromCharacter(seat.Occupant.Parent)
if player then
event:FireClient(player, false)
formerPlayer[seat] = player
else
event:FireClient(formerPlayer[seat], true)
formerPlayer[seat] = nil
end
end)
end
end
local script
local storage = game:WaitForChild("ReplicatedStorage")
local event = storage:WaitForChild("ProximityPrompts")
local function ToggleOnOff(state)
for _, proximityPrompt in pairs(workspace.Vehicles:GetDescendants()) do
if proximityPrompt:IsA("ProximityPrompt") then
proximityPrompt.Enabled = state
end
end
end
event.OnClientEvent:Connect(ToggleOnOff)
any help is very appreciated! since this is one of the core parts of my game