[Solved] Why do i get an error "TranslateBy is not a valid member of Part"?
Asked by
4 years ago Edited 4 years ago
Code:
01 | local Car = game.Workspace.Car |
02 | local Seats = game.Workspace.Car.Seats:GetChildren() |
03 | local Gui = script.Parent:FindFirstChild( "ExitButton" ) |
04 | local Gui 2 = script.Parent:FindFirstChild( "LoadingScreen" ) |
06 | script.Parent.Touched:Connect( function (hit) |
07 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
08 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
09 | for i,v in pairs (Seats) do |
10 | if Seats.Occupant = = nil then |
11 | hit.Parent.Humanoid.JumpPower = 0 |
12 | hit.Parent.Humanoid.WalkSpeed = 0 |
13 | Gui:Clone().Parent = player.PlayerGui |
14 | player.Character.HumanoidRootPart.CFrame = Seats [ math.random( 1 , 12 ) ] .CFrame |
16 | player.PlayerGui.ExitButton:Destroy() |
18 | Car:TranslateBy(Vector 3. new( 0 , 0 ,- 1 )) |
21 | Gui 2 :Clone().Parent = player.PlayerGui |
22 | player.Character.Humanoid.JumpPower = 50 |
24 | player.Character.Humanoid.Jump = true |
26 | player.Character.Humanoid.JumpPower = 0 |
29 | player.Character.HumanoidRootPart.CFrame = game.Workspace.GameTeleporter.CFrame |
31 | player.Character.Humanoid.JumpPower = 50 |
33 | player.Character.Humanoid.Jump = true |
35 | player.Character.Humanoid.JumpPower = 0 |
38 | Car:TranslateBy(Vector 3. new( 0 , 0 , 1 )) |
workspace:https://imgur.com/a/kCDGcVR
I watched this vid as a tut: https://www.youtube.com/watch?v=27nHlMvmbek