so what im trying to do is im trying to make a working hover car for my game which is a racing game so i got a script inside the seat that checks if the player is touching it will change its model value to 1 heres the code for it
script.Parent.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then game.Workspace.HoverCar.Seat.Value = 1 end end)
i also have a local script that checks if your model value = 1 and if it does then it will check if the hovercars model value is well 1 and if it is then it will check if your pressing y key heres the code for it
while true do if game.Players.LocalPlayer.Character.Value.Value = 1 then if game.Workspace.HoverCar.Seat.Value = 1 if true then check mouse.KeyDown:connect(function(key)if key == "y" then game.Workspace.HoverCar.BodyVelocity.Velocity = Vector3.new(0, 1000, 0) end end end
edit removed all the checks and still dosent work and that comment under is not helpful
while true do if game.Players.LocalPlayer.Character.Value.Value = 1 then if game.Workspace.HoverCar.Seat.Value = 1 then if true then mouse.KeyDown:connect(function(key) if key == "y" then game.Workspace.HoverCar.BodyVelocity.Velocity = Vector3.new(0, 1000, 0) end end) end end end end
Believe that fixes it. If not, comment below and I will do my best to make it work :P