I’ve already did the scripting where it pops up the screen gui but I want once I press F It’ll make me go into the nearest VehicleSeat aka car next to me.
Here’s The Script Where The GUI Would Pop Up. Please Help Finish
01 | 1 |
02 | local part = workspace.Part --Change the "part" to the name of the part |
03 | 2 |
04 |
05 | 3 |
06 | part.Touched:connect( function () --I assume this is a local script put inside the frame. |
07 | 4 |
08 | script.Parent.Visible = true |
09 | 5 |
10 | end ) |
11 |
12 |
13 |
14 | —Also This |
15 |
01 | --ScreenGui->LocalScript |
02 | local ply = game.Players.LocalPlayer |
03 | local contextService = game:GetService( "ContextActionService" ) |
04 |
05 | local function seatPlayer(car) |
06 | --Insert your own |
07 | end |
08 | local function findClosestCars() |
09 | local ta = game.Workspace:FindFirstChild( "Cars" ) and game.Workspace:FindFirstChild( "Cars" ):GetChildren() or game.Workspace:GetChildren() |
10 | local closest = nil |
11 | local root = ply.Character.HumanoidRootPart |
12 | local max = 5 |
13 | local shortestDis = max |
14 | for i,v in pairs (ta) do |
15 | if v.Name = = "Car" then |