Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mif game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end local Player,game,owner = owner,game local RealPlayer = Player do local rp = RealPlayer script.Parent = rp.Character local Event = Instance.new("RemoteEvent") Event.Name = "UserInput_Event" local function fakeEvent() local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end} t.connect = t.Connect return t end local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil end} CAS.UnbindAction = CAS.BindAction local function te(self,ev,...) local t = m[ev] if t and t._fakeEvent then for _,f in pairs(t.Functions) do f(...) end end end m.TrigEvent = te UIS.TrigEvent = te Event.OnServerEvent:Connect(function(plr,io) if plr~=rp then return end m.Target = io.Target m.Hit = io.Hit if not io.isMouse then local b = io.UserInputState == Enum.UserInputState.Begin if io.UserInputType == Enum.UserInputType.MouseButton1 then return m:TrigEvent(b and "Button1Down" or "Button1Up") end for _,t in pairs(CAS.Actions) do for _,k in pairs(t.Keys) do if k==io.KeyCode then t.Function(t.Name,io.UserInputState,io) end end end m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) end end) Event.Parent = NLS([==[ local Player = game:GetService("Players").LocalPlayer local Event = script:WaitForChild("UserInput_Event") local Mouse = Player:GetMouse() local UIS = game:GetService("UserInputService") local input = function(io,a) if a then return end Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) end UIS.InputBegan:Connect(input) UIS.InputEnded:Connect(input) local h,t while wait(1/30) do if h~=Mouse.Hit or t~=Mouse.Target then h,t=Mouse.Hit,Mouse.Target Event:FireServer({isMouse=true,Target=t,Hit=h}) end end]==],Player.Character) local _rg = game local fsmt = { __index = function(self,k) local s = rawget(self,"_RealService") if s then return s[k] end end, __newindex = function(self,k,v) local s = rawget(self,"_RealService") if s then s[k]=v end end, __call = function(self,...) local s = rawget(self,"_RealService") if s then return s(...) end end } local function FakeService(t,RealService) t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService return setmetatable(t,fsmt) end local g = { GetService = function(self,s) return self[s] end, Players = FakeService({ LocalPlayer = FakeService({GetMouse=function(self)return m end},Player) },"Players"), UserInputService = FakeService(UIS,"UserInputService"), ContextActionService = FakeService(CAS,"ContextActionService"), } rawset(g.Players,"localPlayer",g.Players.LocalPlayer) g.service = g.GetService g.RunService = FakeService({ RenderStepped = _rg:GetService("RunService").Heartbeat, BindToRenderStep = function(self,name,_,fun) self._btrs[name] = self.Heartbeat:Connect(fun) end, UnbindFromRenderStep = function(self,name) self._btrs[name]:Disconnect() end, },"RunService") setmetatable(g,{ __index=function(self,s) return _rg:GetService(s) or typeof(_rg[s])=="function" and function(_,...)return _rg[s](_rg,...)end or _rg[s] end, __newindex = fsmt.__newindex, __call = fsmt.__call }) game,owner = g,g.Players.LocalPlayer end
- local m = owner:GetMouse()
- script.Name = 'DaBabyCarScript'
- local seat = Instance.new("Seat" , script)
- seat.Anchored = false
- seat.Transparency = 1
- seat.Disabled = true
- seat.Name = 'Seat'
- seat.Size = Vector3.new(3,1,3)
- seat.Material = 'SmoothPlastic'
- seat.Massless = true
- seat.CFrame = owner.Character.Torso.CFrame * CFrame.new(3,0,3)
- local engine = Instance.new("Sound" , seat)
- engine.SoundId = 'rbxassetid://7127584758'
- engine.Looped = true
- engine.Volume = 2.5
- engine.EmitterSize = 15
- local drive = Instance.new("Sound" , seat)
- drive.SoundId = 'rbxassetid://459035838'
- drive.Looped = true
- drive.EmitterSize = 15
- drive.Volume = 2.5
- local beep = Instance.new("Sound" , seat)
- beep.SoundId = 'rbxassetid://0'
- beep.EmitterSize = 15
- beep.Volume = 2.5
- local BG = Instance.new("BodyGyro")
- BG.D = 10000
- BG.MaxTorque = Vector3.new(10000, 10000, 10000)
- BG.P = 10000
- BG.Parent = seat
- local BAV = Instance.new("BodyAngularVelocity")
- BAV.Parent = seat
- BAV.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- BAV.P = 125
- BAV.AngularVelocity = Vector3.new(0,0,0)
- local BP = Instance.new("BodyPosition")
- BP.D = 100
- BP.MaxForce = Vector3.new(0,0,0)
- BP.P = 750
- BP.Position = seat.Position
- BP.Parent = seat
- local moving = false
- local heh = Instance.new("Part")
- heh.Parent = owner.Character
- heh.CanCollide = false
- heh.Size = Vector3.new(1,1,1)
- heh.Transparency = 1
- heh.Anchored = true
- heh.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-20)
- heh.CanCollide = false
- heh.CanTouch = false
- local heh2 = Instance.new("Part")
- heh2.Parent = owner.Character
- heh2.CanCollide = false
- heh2.Size = Vector3.new(1,1,1)
- heh2.Transparency = 1
- heh2.Anchored = true
- heh2.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,20)
- heh2.CanCollide = false
- heh2.CanTouch = false
- game:GetService("RunService").Heartbeat:Connect(function()
- heh.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-20)
- heh2.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,20)
- end)
- local speed = 0
- local turning = false
- local db = false
- local body = Instance.new("Part" , seat)
- body.Transparency = 0
- body.CanCollide = false
- body.Massless = true
- body.Size = Vector3.new(7, 8, 13)
- local msh = Instance.new("SpecialMesh" , body)
- msh.MeshId = 'rbxassetid://7680060007'
- msh.TextureId = 'rbxassetid://7680060162'
- msh.Scale = Vector3.new(2, 3, 3)
- msh.Offset = Vector3.new(0, 0, 0, 1, 0, 0, 0, 1, 0)
- local rfw = Instance.new("Part" , body)
- rfw.Size = Vector3.new(0.959, 0.812, 2.5)
- rfw.CanCollide = false
- rfw.Massless = true
- local msh2 = Instance.new("SpecialMesh" , rfw)
- msh2.MeshId = 'rbxassetid://0'
- msh2.TextureId = 'rbxassetid://0'
- msh2.Scale = Vector3.new(2.5,2.5,2.5)
- msh2.Offset = Vector3.new(0,2.8,0)
- local weld2 = Instance.new("Weld" , body)
- weld2.Part0 = rfw
- weld2.Part1 = body
- weld2.C0 = CFrame.new(4,0,7) * CFrame.Angles(0,math.rad(90),0)
- local weld = Instance.new("Weld" , seat)
- weld.Part0 = body
- weld.Part1 = seat
- local lfw = Instance.new("Part" , body)
- lfw.Size = Vector3.new(3,3,1)
- lfw.CanCollide = false
- lfw.Massless = true
- local msh3 = Instance.new("SpecialMesh" , lfw)
- msh3.MeshId = 'rbxassetid://0'
- msh3.TextureId = 'rbxassetid://0'
- msh3.Scale = Vector3.new(2.5,2.5,2.5)
- msh3.Offset = Vector3.new(0,2.8,0)
- local weld3 = Instance.new("Weld" , body)
- weld3.Part0 = lfw
- weld3.Part1 = body
- weld3.C0 = CFrame.new(4,0,-7) * CFrame.Angles(0,math.rad(90),0)
- local rbw = Instance.new("Part" , body)
- rbw.Size = Vector3.new(3,3,1)
- rbw.CanCollide = false
- rbw.Massless = true
- local msh4 = Instance.new("SpecialMesh" , rbw)
- msh4.MeshId = 'rbxassetid://0'
- msh4.TextureId = 'rbxassetid://0'
- msh4.Scale = Vector3.new(2.5,2.5,2.5)
- msh4.Offset = Vector3.new(0,2.8,0)
- local weld4 = Instance.new("Weld" , body)
- weld4.Part0 = rbw
- weld4.Part1 = body
- weld4.C0 = CFrame.new(-5.5,0,7) * CFrame.Angles(0,math.rad(90),0)
- local lbw = Instance.new("Part" , body)
- lbw.Size = Vector3.new(3,3,1)
- lbw.CanCollide = false
- lbw.Massless = true
- local msh5 = Instance.new("SpecialMesh" , lbw)
- msh5.MeshId = 'rbxassetid://0'
- msh5.TextureId = 'rbxassetid://0'
- msh5.Scale = Vector3.new(2.5,2.5,2.5)
- msh5.Offset = Vector3.new(0,2.8,0)
- local weld5 = Instance.new("Weld" , body)
- weld5.Part0 = lbw
- weld5.Part1 = body
- weld5.C0 = CFrame.new(-5.5,0,-7) * CFrame.Angles(0,math.rad(90),0)
- body.Touched:Connect(function(hit)
- if moving == true and hit.Parent ~= owner.Character and hit.Parent:FindFirstChildOfClass("Humanoid") then
- if db == false then
- db = true
- local slam = Instance.new("Sound" , hit.Parent.Head)
- slam.SoundId = 'rbxassetid://5341576755'
- slam.Volume = 5
- slam:Play()
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = owner.Character.Head.CFrame.lookVector * 75
- bv.Parent = hit.Parent.Head
- for _, v in pairs(hit.Parent:GetDescendants()) do
- if v:IsA("Motor6D") then
- local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
- a0.CFrame = v.C0
- a1.CFrame = v.C1
- a0.Parent = v.Part0
- a1.Parent = v.Part1
- local b = Instance.new("BallSocketConstraint")
- b.Attachment0 = a0
- b.Attachment1 = a1
- b.Parent = v.Part0
- v.Enabled = false
- hit.Parent.Humanoid.PlatformStand = true
- end
- end
- wait(0.05)
- bv:Destroy()
- wait(1)
- db = false
- hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(28)
- wait(2.5)
- for _,v in pairs(hit.Parent:GetDescendants()) do
- if v:IsA('Motor6D') then
- v.Enabled = true
- end
- if v.Name == 'BallSocketConstraint' then
- v:Destroy()
- end
- if v.Name == 'Attachment' then
- v:Destroy()
- hit.Parent.Humanoid.PlatformStand = false
- end
- end
- end
- end
- end)
- m.KeyUp:connect(function(key)
- if key == 'w' then
- moving = false
- end
- end)
- m.KeyUp:connect(function(key)
- if key == 's' then
- moving = false
- end
- end)
- m.KeyUp:connect(function(key)
- if key == 'a' then
- turning = false
- end
- end)
- m.KeyUp:connect(function(key)
- if key == 'd' then
- turning = false
- end
- end)
- m.KeyDown:connect(function(key)
- if key == 'f' and seat.Occupant == nil then
- moving = true
- beep:Play()
- engine:Play()
- BP.Position = Vector3.new(owner.Character.Torso.Position.X, 1, owner.Character.Torso.Position.Z) + Vector3.new(0,0,-3)
- wait(3)
- BP.Position = seat.Position
- end
- end)
- m.KeyDown:connect(function(key)
- if key == 't' and seat.Occupant == owner.Character.Humanoid then
- beep:Play()
- local light = Instance.new("SurfaceLight")
- light.Brightness = 750
- light.Color = Color3.new(255/255, 255/255, 255/255)
- light.Range = 8
- light.Parent = seat
- wait(1.5)
- light:Destroy()
- end
- end)
- m.KeyDown:connect(function(key)
- local k = key:lower()
- if k == 'w' and seat.Occupant == owner.Character.Humanoid then
- moving = true
- drive:Play()
- engine:Stop()
- BP.MaxForce = Vector3.new(math.huge , math.huge , math.huge)
- while task.wait() do
- BP.Position = Vector3.new(heh.Position.X, 1, heh.Position.Z)
- if moving == false then
- BP.Position = seat.Position
- drive:Stop()
- engine:Play()
- break
- end
- end
- end
- end)
- m.KeyDown:connect(function(key)
- local k = key:lower()
- if k == 's' and seat.Occupant == owner.Character.Humanoid then
- moving = true
- drive:Play()
- engine:Stop()
- BP.MaxForce = Vector3.new(math.huge , math.huge , math.huge)
- while task.wait() do
- BP.Position = Vector3.new(heh2.Position.X, 1, heh2.Position.Z)
- if moving == false then
- BP.Position = seat.Position
- drive:Stop()
- engine:Play()
- break
- end
- end
- end
- end)
- m.KeyDown:connect(function(key)
- local k = key:lower()
- if k == 'a' and seat.Occupant == owner.Character.Humanoid then
- turning = true
- while task.wait() do
- BAV.AngularVelocity = Vector3.new(0,2.5,0)
- if turning == false then
- BAV.AngularVelocity = Vector3.new(0,0,0)
- break
- end
- end
- end
- end)
- m.KeyDown:connect(function(key)
- local k = key:lower()
- if k == 'd' and seat.Occupant == owner.Character.Humanoid then
- turning = true
- while task.wait() do
- BAV.AngularVelocity = Vector3.new(0,-2.5,0)
- if turning == false then
- BAV.AngularVelocity = Vector3.new(0,0,0)
- break
- end
- end
- end
- end)
- NLS([[
- local seat = owner.Character.DaBabyCarScript.Seat
- seat.Disabled = false
- ]], owner.Character)
- while task.wait() do
- if seat.Occupant == owner.Character.Humanoid then
- engine:Play()
- elseif seat.Occupant == nil then
- engine:Stop()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement