Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(2)
- print("f")
- local player = game.Players.LocalPlayer
- local char = player.Character
- --local f = false
- local car = false
- local mouse = player:GetMouse()
- local selected = workspace.mid
- mouse.Button1Down:connect(function()
- if car==false then
- if mouse.Target.Parent.Name=="twin" then
- selected = mouse.Target.Parent.cameraholder.camera
- car = true
- end
- end
- end)
- while car==false do
- wait(0.3)
- end
- local twin = selected.Parent.Parent
- script.fuelusing.Changed:Connect(function()
- if script.fuelusing.Value==false then
- twin.nitro.stopped:FireServer()
- end
- if script.fuelusing.Value==true then
- twin.nitro:FireServer()
- end
- end)
- mouse.Button2Down:connect(function()
- player.PlayerGui.Screen.fuel.using:Fire()
- end)
- mouse.Button2Up:connect(function()
- player.PlayerGui.Screen.fuel.stopped:Fire()
- script.fuelusing.Value = false
- end)
- mouse.KeyDown:connect(function(key)
- if key=="f" then
- twin.f:FireServer()
- end
- if key=="w" then
- twin.w.on:FireServer()
- end
- if key=="s" then
- twin.s.on:FireServer()
- end
- if key=="a" then
- twin.a.on:FireServer()
- end
- if key=="d" then
- twin.d.on:FireServer()
- end
- if key=="f" then
- --twin.f:FireServer()
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key=="f" then
- end
- if key=="w" then
- twin.w.off:FireServer()
- end
- if key=="s" then
- twin.s.off:FireServer()
- end
- if key=="a" then
- twin.a.off:FireServer()
- end
- if key=="d" then
- twin.d.off:FireServer()
- end
- end)
- local finalflip = 0
- twin.setflip.OnClientEvent:connect(function(set)
- --print(finalflip)
- --print("started")
- if finalflip>2 then
- player.PlayerGui.Screen.flippoints.Visible = true
- player.PlayerGui.Screen.flippoints.Text = "Points +"..set
- end
- finalflip = set
- end)
- twin.stopflip.OnClientEvent:connect(function()
- --print("stopped")
- if finalflip>2 then
- player.PlayerGui.Screen.addpoints.pointsobject:Fire(finalflip/2)
- end
- finalflip = 0
- player.PlayerGui.Screen.flippoints.Visible = false
- player.PlayerGui.Screen.flippoints.Text = "Points +0"
- end)
- local chill = char:GetChildren()
- for i=1,#chill do
- if chill[i]:IsA("BasePart") then
- chill[i].Transparency = 1
- end
- end
- local RunService = game:GetService("RunService")
- local RATE_PER_SECOND = 2
- local x = 0
- local old
- local new
- local firstrun = true
- local flip = false
- RunService.RenderStepped:Connect(function()
- --local increment = RATE_PER_SECOND * step
- --workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
- if flip==true then
- flip = false
- old = twin.cameraholder.camera.WorldCFrame
- else
- flip = true
- new = twin.cameraholder.camera.WorldCFrame
- end
- if firstrun==true then
- workspace.CurrentCamera.CFrame=twin.cameraholder.camera.WorldCFrame
- firstrun = false
- end
- --workspace.CurrentCamera.CFrame=CFrame.new((old.p+new.p)/2,((old.LookVector+old.p)+(new.LookVector+new.p))/2)
- --workspace.CurrentCamera.CameraType = Enum.CameraType.Fixed
- workspace.CurrentCamera.CameraSubject = twin.cameraholder
- workspace.Terrain.render:FireServer()
- if twin.Chassis.av.Enabled==true then
- local c = Instance.new("Part")
- c.Parent = workspace
- c.CFrame = twin.Chassis.CFrame
- c.Anchored = true
- c.CanCollide = false
- c.Orientation = twin.Chassis.beforespin.Value
- local att = Instance.new("Attachment")
- att.Parent = c
- att.CFrame = twin.cameraholder.camera.CFrame
- local j = att.WorldCFrame
- --
- c:Destroy()
- end
- end)
- --script named bodyhandler
- local twin = script.Parent
- script.go.Event:Connect(function()
- local hold = twin.bodyhold
- hold.CFrame = twin.center.CFrame
- hold.Position = twin.center.Position+script.posoffset.Value
- twin.body.Mesh.Scale = script.size.Value
- twin.body.CFrame = twin.bodyhold.WorldCFrame
- end)
- --script named engine
- local ftime = 0
- local flimit = 250
- local fdiv = 30000
- script.cycle.Event:Connect(function()
- local twin = script.Parent
- local w = twin.w.Value
- local s = twin.s.Value
- local a = twin.a.Value
- local d = twin.d.Value
- local f = 0
- local t = 0
- if w==true and s==false then
- f=1
- if a==true and d==false then
- t=1
- end
- if a==false and d==true then
- t=-1
- end
- end
- if w==false and s==true then
- f=-1
- if a==true and d==false then
- t=-1
- end
- if a==false and d==true then
- t=1
- end
- end
- if w==false and s==false then
- f=0
- t=0
- end
- if a==false and d==false then
- t=0
- end
- if f==1 and twin.canforward.Value==false then
- --f=0
- end
- if f==-1 and twin.canbackward.Value==false then
- --f=0
- end
- local speed = script.Parent.speed.Value
- local turnspeed = script.Parent.turnspeed.Value
- if f==1 then
- twin.enginepush.Position = Vector3.new(0,0,-1*((ftime*ftime)/fdiv))
- end
- if f==-1 then
- twin.enginepush.Position = Vector3.new(0,0,-1*((ftime*ftime)/fdiv))
- end
- if f==0 then
- twin.enginepush.Position = Vector3.new(0,0,-1*((ftime*ftime)/fdiv))
- end
- if t==1 then
- twin.enginepush.Orientation = Vector3.new(0,0.01*turnspeed,0)
- end
- if t==-1 then
- twin.enginepush.Orientation = Vector3.new(0,-0.01*turnspeed,0)
- end
- if t==0 then
- twin.enginepush.Orientation = Vector3.new(0,0,0)
- end
- if ftime<flimit and f==1 then
- ftime=ftime+1
- end
- if f==1 then else
- if ftime>4 then
- ftime = ftime-4
- else
- ftime = 0
- end
- end
- end)
- --script named rotate vh
- local twin = script.Parent
- script.go.Event:Connect(function(tiltv,tilth,center)
- if twin.airbound.Value==false then
- local mul = 0.5
- if twin.testforblockunder.output.Value==true then
- mul = 0.25
- end
- local v = CFrame.new(center,tiltv)
- local h = CFrame.new(center,tilth)
- local partv = Instance.new("Part")
- partv.CFrame = v
- local va = partv.Orientation.X*mul
- local parth = Instance.new("Part")
- parth.CFrame = h
- local ha = parth.Orientation.X*mul
- --print(va,ha)
- partv:Destroy()
- parth:Destroy()
- local reversevel = twin.reversevel
- local future = twin.future
- future.Orientation = Vector3.new(va,0,ha)
- twin.combine.Position = (twin.future.Position+twin.enginepush.Position)*mul
- twin.combine.Orientation = twin.future.Orientation+(twin.enginepush.Orientation)
- reversevel.CFrame = twin.combine.CFrame
- --local test = twin.testforcol.go:Fire()
- local detected = false
- local c = twin.body:Clone()
- c.Mesh:Destroy()
- c.Size = c.Size*1.1
- twin.placetest.CFrame = twin.combine.CFrame
- twin.placetest.Position = Vector3.new(
- twin.combine.Position.X,
- twin.combine.Position.Y+twin.vehicleYNN.Value.X+2.6,
- twin.combine.Position.Z
- )
- c.CFrame = twin.placetest.WorldCFrame
- c.Parent = workspace.ignore
- local col = c:GetTouchingParts()
- c.Parent = game.Lighting
- for i=1,#col do
- if col[i].Name=="col" then
- detected = true
- end
- end
- c:Destroy()
- -- print(detected)
- if detected then else
- twin.velocityhandling.record:Fire(
- twin.combine.Position.X,
- twin.combine.Position.Y,
- twin.combine.Position.Z
- )
- twin.CFrame = twin.combine.WorldCFrame
- end
- else
- twin.velocityhandling.let:Fire()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement