I don’t think that would cause any issue, but maybe try to remove/comment the
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant then
proximityPromt.Enabled = false
else
proximityPromt.Enabled = true
end
end)
I don’t think that would cause any issue, but maybe try to remove/comment the
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant then
proximityPromt.Enabled = false
else
proximityPromt.Enabled = true
end
end)
Eureka, it worked! But there was only one exception, when I jumped off of the seat, I went to check the seat that the other player was sitting on, the prompt showed up… It didn’t show up at first, but after getting off of the vehicle, it showed up…
I think you could do this for the event??
game:GetService("ReplicatedStorage").TogglePrompts.OnClientEvent:Connect(function(state)
for _,v in pairs(workspace:GetDescendants()) do
if v.ClassName ~= "ProximityPrompt" then continue end
local parent = v.Parent
if not parent:IsA("Seat") or not parent.Occupant then
v.Enabled = state
end
end
end)
So if the Parent of the prompt is not a seat or if it is and it doesn’t have an occupant, set the property, I think it should work? But you still may need to do some more code and what not for the prompts
What the image is trying to say is that there’s still someone inside and the prompt still shows up.
I think that would require me to look through your place files, could you send me the palce file for taht so I can check it out later?
Okay sorry for my late response, I’ve been busy for a bit, I see an Occupant event in y our EnterExitDriveSeat, maybe you could change it to this?
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local hum = seat.Occupant
if hum then
formerOccupant = hum.Parent
proximityPromt.Enabled = false
else
wait()
formerOccupant.HumanoidRootPart.CFrame = seat.CFrame + (seat.CFrame.RightVector * -5)
formerOccupant = nil
proximityPromt.Enabled = true
end
end)
Sorry for the late response, but that doesn’t work still.
I’m honestly stumped now, I think you may need to tweak/add some code around to figure out how you can prevent it, since I’m running out of ideas and I can’t really do local server tests that much since my laptop is quite slow
welp, I guess I’m on my own now, thanks for trying!!!
I’m terribly sorry that I cannot help you anymore! But I can still help if you’re getting errors and what not! I’ll still of course help you with other issues!
I have a question. Wouldn’t this be very consuming? Looping through every element in the workspace to get the prompts?
I’m extremely late, but yes it does, and it is uncessary. ProximityPromptService
has a property Enabled
, that lets you disable all ProximityPrompts when set to false
and vice versa is set to true
. It can also be ran locally.
https://developer.roblox.com/en-us/api-reference/property/ProximityPromptService/Enabled