of     1   

EmperorEnergy
#138599329Sunday, June 29, 2014 7:50 AM GMT

Theres 2 scripts, its for a drive tool. 1: bin=script.Parent speed= nil plane=nil hold=false local debounce = false local planedebounce = false local stuntdebounce = false local controlling = false function fire(pln,spn) local missile = bin.Rocket:clone() missile.CFrame = spn.CFrame * CFrame.new(0, 0, -35) missile.RocketScript.Disabled = false missile.Parent = game.Workspace local creator_tag = Instance.new("ObjectValue") creator_tag.Value = game.Players.LocalPlayer creator_tag.Name = "creator" creator_tag.Parent = missile missile.Owner.Value = pln end function computeDirection(vec) local lenSquared = vec.magnitude * vec.magnitude local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) end function move(target, engine) local origincframe = engine:findFirstChild("BodyGyro").cframe local dir = (target - engine.Position).unit local spawnPos = engine.Position local pos = spawnPos + (dir * 1) engine:findFirstChild("BodyGyro").maxTorque = Vector3.new(0, 3000, 0) engine:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir) wait(0.1) engine:findFirstChild("BodyGyro").maxTorque = Vector3.new(0, 0, 0) engine:findFirstChild("BodyGyro").cframe = origincframe end function findPlane(player) local list = player.Character:GetChildren() for x = 1, #list do if (list[x].Name == "VS3") then local weld = list[x]:FindFirstChild("Parts"):FindFirstChild("Seat"):FindFirstChild("SeatWeld") if (weld ~= nil) and (weld.Part1 == player.Character:FindFirstChild("HumanoidRootPart")) then return list[x] end end end return nil end function onButton1Down(mouse) local vehicle = findPlane(script.Parent.Parent.Parent) if vehicle ~= nil and debounce == false and planedebounce == false and vehicle.Parts.Engine.Speed.Value ~= 0 then debounce = true controlling = true while true do wait() local engine = vehicle.Parts.Engine local position = mouse.Hit local target = position.p if engine:findFirstChild("FlyScript") ~= nil then move(target, engine) end if planedebounce == true or controlling == false then break end end wait(.1) debounce = false end end function onButton1Up(mouse) controlling = false end function onSelected(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.Button1Up:connect(function() onButton1Up(mouse) end) mouse.KeyDown:connect(onKeyDown) end function onKeyDown(key) if (key~=nil) then key = key:lower() local vehicle = findPlane(script.Parent.Parent.Parent) if (vehicle==nil) then return end plane = vehicle.Parts local engine = vehicle.Parts.Engine local r1 = engine.Parent.r1 local r2 = engine.Parent.r2 local l1 = engine.Parent.l1 local l2 = engine.Parent.l2 local Siren = plane.Lights.Siren if (key=="r") then if Siren.Value == false then plane.Engine.Siren:Play() Siren.Value = true else if Siren.Value == true then plane.Engine.Siren:Stop() Siren.Value = false end end end local Strobe = plane.Lights.Strobe if (key=="e") then if Strobe.Value == false then Strobe.Value = true else if Strobe.Value == true then Strobe.Value = false end end end local Mode = plane.Lights.Mode if (key=="f") then if Mode.Value < 5 then Mode.Value = Mode.Value + 1 else if Mode.Value >= 5 then Mode.Value = 0 end end end if (key=="x") and planedebounce == false then speed = plane.Engine.Speed local power = plane.Engine:findFirstChild("FlyScript") if (power ~= nil) then power:remove() end speed.Value = 0 r1.TopParamB= 0 r1.TopParamA= 0 r2.TopParamB= 0 r2.TopParamA= 0 l1.TopParamB= 0 l1.TopParamA= 0 l2.TopParamB= 0 l2.TopParamA= 0 end if (key=="y") then speed = plane.Engine.Speed local power = plane.Engine:findFirstChild("FlyScript") if (power ~= nil) then return end local fly = script.FlyScript:clone() fly.Disabled = true fly.Parent = plane.Engine r1.TopParamB= speed.Value*-1 r1.TopParamA= speed.Value r2.TopParamB= speed.Value*-1 r2.TopParamA= speed.Value l1.TopParamB= speed.Value l1.TopParamA= speed.Value*-1 l2.TopParamB= speed.Value l2.TopParamA= speed.Value*-1 end if (key=="h") then plane.Lights.Front.L.SpotLight.Enabled = not plane.Lights.Front.L.SpotLight.Enabled plane.Lights.Front.R.SpotLight.Enabled = not plane.Lights.Front.R.SpotLight.Enabled end if (key=="m") then if speed.Value < 5 then speed.Value = speed.Value +1 else speed.Value = 5 end end if (key=="n") then if speed.Value > -1 then speed.Value = speed.Value -1 else speed.Value = -1 end end if (key=="k") and planedebounce == false then wait() engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0) wait() engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0) wait() engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0) wait() engine.RotVelocity = Vector3.new(0, engine.RotVelocity.y -0.7, 0) end if (key=="j") and planedebounce == false then local body = plane.Engine.BodyGyro body.maxTorque = Vector3.new(9000, 9000, 9000) local position = engine.CFrame * Vector3.new(0, 0.5, -4) local dir = position - engine.Position dir = computeDirection(dir) local spawnPos = engine.Position local pos = spawnPos + (dir * 8) body.cframe = CFrame.new(pos, pos + dir) wait(.2) body.maxTorque = Vector3.new(0, 0, 0) end if (key=="l") and planedebounce == false then local body = plane.Engine.BodyGyro body.maxTorque = Vector3.new(9000, 0, 0) local frame = plane:FindFirstChild("OriginCFrame") if frame ~= nil then body.cframe = frame.Value end wait(0.1) body.maxTorque = Vector3.new(0, 0, 0) end if (key=="u") and planedebounce == false then local body = plane.Engine.BodyGyro body.maxTorque = Vector3.new(9000, 9000, 9000) local position = engine.CFrame * Vector3.new(0, -0.5, -4) local dir = position - engine.Position dir = computeDirection(dir) local spawnPos = engine.Position local pos = spawnPos + (dir * 8) body.cframe = CFrame.new(pos, pos + dir) wait(.2) body.maxTorque = Vector3.new(0, 0, 0) end end end bin.Selected:connect(onSelected) 2: local engine = script.Parent.Parent.Engine local spd = 0 local position = engine.Position while true do wait(0.1) direction = engine.CFrame.lookVector position = position + spd*0*direction error = position - engine.Position engine.Velocity = spd*error engine.RotVelocity = Vector3.new(0, 0, 0) end
smiley599
#138599788Sunday, June 29, 2014 8:00 AM GMT

Yeah cheers for this.

    of     1