-
What do you want to achieve? Keep it simple and clear!
I’m trying to eject the player from the vehicle when they press the spacebar. Because the vehicle has collisions I have to teleport them to another part. (the part being “GetOutRR”) -
What is the issue? Include screenshots / videos if possible!
I am trying to teleport them to a different part. Below is the error I’m getting.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
This is a pretty specific issue that I had a hard time finding. This is my code so far
local mouse=game.Players.LocalPlayer:GetMouse()
local player = game.Players.LocalPlayer
local veh = script.Parent.Parent.Parent.Parent.Parent
mouse.KeyDown:connect(function(key)
if key==" " then
game.Workspace:FindFirstChild(player.Name):FindFirstChild("HumanoidRootPart").CFrame = veh.GetOutRR.CFrame
end
end
Does anyone know why it’s saying that the part is not a valid member of the player, even though I’m not trying to find the part inside the player? I’m very new to coding so it might be obvious. This is also my first time asking for coding assistance, so sorry if I didn’t give enough information.
