You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want to destroy the weld as soon as the player has jumped.
-
What is the issue? Sometimes the weld gets destroyed, other times it doesnt. I think this is due to the jump event not firing sometimes which I found through print debugging. But it doesn’t make sense why sometimes it works and sometimes it doesn’t.
-
What solutions have you tried so far? I tried destroying the weld outside of the proxprompt with a humanoid.Jump event inside a characteradded event (server-side) and that didn’t help. destroyed the weld on the client and it worked however I don’t think this is the best idea especially if there is an alternative. I know that the client reacts faster but c’mon now server-side jump event shouldn’t mean that the event will run sometimes and sometimes not. I also tried using the statechanged event (server-side) but that didn’t help either.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Server side script
local Car = workspace.Car
local SeatPart = workspace.SeatPart
local Prompt = Car.ProximityPrompt
Prompt.Triggered:Connect(function(Player)
local Character = Player.Character
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Weld = Instance.new("Weld", SeatPart)
Weld.Part0 = SeatPart
Weld.Part1 = Character:FindFirstChild("HumanoidRootPart")
Weld.C0 = CFrame.new(0,2,0)
Humanoid.Sit = true
Humanoid.Jumping:Connect(function() -- This event sometimes fires, sometimes doesn't
Character:FindFirstChild("HumanoidRootPart").CFrame = SeatPart.CFrame * CFrame.new(-4,0,0)
Weld:Destroy()
end)
end)