Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- 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}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- 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 UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- 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)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- print([[
- lmao why did i choose to
- create an
- garf gun
- ]])
- Plr = owner
- Char = Plr.Character
- Create = Instance.new
- local txt = Instance.new("BillboardGui", Char)
- txt.Adornee = Char .Head
- txt.Name = "_status"
- txt.Size = UDim2.new(2, 0, 0.2, 0)
- txt.StudsOffset = Vector3.new(-9, 3, 0)
- local text = Instance.new("TextLabel", txt)
- text.Size = UDim2.new(10, 0, 7, 0)
- text.FontSize = "Size24"
- text.TextScaled = true
- text.TextTransparency = 0
- text.BackgroundTransparency = 1
- text.TextTransparency = 0
- text.TextStrokeTransparency = 0
- text.Font = "Highway"
- text.TextStrokeColor3 = BrickColor.new("Dark orange").Color
- text.TextColor3 = BrickColor.new("Deep orange").Color
- text.Text = owner.Name:lower().." has an garfield gun"
- local Sound = Instance.new("Sound", workspace)
- Sound.SoundId = "rbxassetid://174890238"
- Sound.Volume = 2
- Sound:Play()
- function wbtwe(Part0, Part1, C0)
- local weld = Instance.new("Weld", Part0)
- weld.Part0 = Part0
- weld.Part1 = Part1
- weld.C0 = Part1.CFrame:inverse() *Part1.CFrame *C0
- return weld
- end
- idle = 3.7
- walk = 1
- tilt = 1
- animateing = false
- deb = false
- hrw = wbtwe(owner.Character.Torso, owner.Character.HumanoidRootPart, CFrame.new(0, 0, 0))
- law = wbtwe(owner.Character["Left Arm"], owner.Character.Torso, CFrame.new(1.45, 0.1, 0.1) *CFrame.Angles(0, 25, 0.3))
- raw = wbtwe(owner.Character["Right Arm"], owner.Character.Torso, CFrame.new(-1.4, 0.1, 0) *CFrame.Angles(0, 0, -0.3))
- llw = wbtwe(owner.Character["Left Leg"], owner.Character.Torso, CFrame.new(0.45, 2.1, 0) *CFrame.Angles(0, 25, 0))
- rlw = wbtwe(owner.Character["Right Leg"], owner.Character.Torso, CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0))
- hw = wbtwe(owner.Character.Head, owner.Character.Torso, CFrame.new(0, -1.45, 0) *CFrame.Angles(0, 0, 0))
- Char.Humanoid.WalkSpeed = 45
- Char.Humanoid.JumpPower = 67
- local sound = Instance.new("Sound", owner.Character.Head)
- sound.SoundId = "rbxassetid://2586147657"
- sound.Volume = 2
- sound.PlaybackSpeed = 1.2
- local Distortion = Instance.new("FlangeSoundEffect")
- Distortion.Rate = 8
- Distortion.Parent = sound
- sound:Play()
- arms = 1
- gun = Create("Part", owner.Character)
- gun.Size = Vector3.new(0.64, 1.15, 3.55)
- gun.CanCollide = false
- gunw = wbtwe(gun, owner.Character["Right Arm"], CFrame.new(0, 1.3, 0))
- specialmesh = Create("SpecialMesh", gun)
- specialmesh.MeshId = "http://www.roblox.com/asset/?id=94690054"
- specialmesh.TextureId = "http://www.roblox.com/asset/?id=94689966"
- specialmesh.Scale = Vector3.new(1, 1, 1)
- boom = Create("Sound", gun)
- boom.SoundId = "rbxassetid://573314737"
- boom.Volume = 3
- head = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- for i = 0,1,0.1 do
- game:GetService("RunService").Stepped:wait()
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.45, 0.5) *CFrame.Angles(-0.5, 0, 0), 0.5)
- end
- for i = 0,1,0.1 do
- game:GetService("RunService").Stepped:wait()
- hw.C0 = hw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0, -1.45, -0.5) *CFrame.Angles(0.5, 0, 0), 0.5)
- end
- end
- end)head()
- health = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- Char.Humanoid.MaxHealth = math.huge
- Char.Humanoid.Health = math.huge
- end
- end)health()
- anim = coroutine.wrap(function()
- while game:GetService("RunService").Stepped:wait() do
- if Char.HumanoidRootPart.Velocity.Magnitude < 1 then
- arms = arms +0.6
- for i = 0,1,0.1 do
- game:GetService("RunService").Stepped:wait()
- arms = arms +0.3
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.45, 0.1, 0.1) *CFrame.Angles(0, 25, math.sin(arms) *1), 0.1)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.4, 0.1, 0.1) *CFrame.Angles(0, 0, math.sin(-arms) *1), 0.1)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 0) *CFrame.Angles(0, 25, 0), 0.1)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 2.1, 0) *CFrame.Angles(0, 0, 0), 0.1)
- end
- end
- if Char.HumanoidRootPart.Velocity.Magnitude > 1 then
- for i = 0,1,0.1 do
- game:GetService("RunService").Stepped:wait()
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.45, 0, -1) *CFrame.Angles(1.7, 25, 0), 0.1)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.4, 0, 1) *CFrame.Angles(-1.7, 0, 0), 0.1)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, -0.4) *CFrame.Angles(1.7, 25, 0), 0.1)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 2.1, 0.4) *CFrame.Angles(-1.7, 0, 0), 0.1)
- end
- for i = 0,1,0.1 do
- game:GetService("RunService").Stepped:wait()
- law.C0 = law.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(1.45, 0, 1) *CFrame.Angles(-1.7, 25, 0), 0.1)
- raw.C0 = raw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-1.4, 0, -1) *CFrame.Angles(1.7, 0, 0), 0.1)
- llw.C0 = llw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(0.45, 2.1, 0.4) *CFrame.Angles(-1.7, 25, 0), 0.1)
- rlw.C0 = rlw.C0:lerp(owner.Character.Torso.CFrame:inverse() *owner.Character.Torso.CFrame *CFrame.new(-0.4, 2.1, -0.4) *CFrame.Angles(1.7, 0, 0), 0.1)
- end
- end
- end
- end)anim()
- mouse.Button1Down:connect(function()
- boom:Play()
- text.Text = "bom"
- wait(0.2)
- text.Text = owner.Name:lower().." has an garfield gun"
- local garf = Instance.new("Part", workspace)
- garf.Anchored = true
- garf.Position = mouse.Hit.p
- garf.CanCollide = false
- local explode = Instance.new("Part", workspace)
- explode.Anchored = true
- explode.Position = garf.Position
- explode.Shape = "Ball"
- explode.Size = Vector3.new(5, 5, 5)
- explode.BrickColor = BrickColor.new("Bright orange")
- explode.Material = "Neon"
- explode.Transparency = 0.4
- explode.CanCollide = false
- specialmesh = Create("SpecialMesh", garf)
- specialmesh.MeshId = "rbxassetid://710763311"
- specialmesh.TextureId = "rbxassetid://710763383"
- specialmesh.Scale = Vector3.new(15, 15, 15)
- local ray = Ray.new(gun.CFrame.p, (mouse.Hit.p - gun.CFrame.p).unit*300)
- local hit, position = workspace:FindPartOnRay(ray, owner.Character)
- --do damage to any humanoids hit
- local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
- if humanoid then
- humanoid:TakeDamage(30)
- end
- --draw the ray
- local distance = (position - gun.CFrame.p).magnitude
- local rayPart = Instance.new("Part", owner.Character)
- rayPart.Name = "RayPart"
- rayPart.BrickColor = BrickColor.new("Bright orange")
- rayPart.Material = "Neon"
- rayPart.Transparency = 0.4
- rayPart.Anchored = true
- rayPart.CanCollide = false
- rayPart.TopSurface = Enum.SurfaceType.Smooth
- rayPart.BottomSurface = Enum.SurfaceType.Smooth
- rayPart.formFactor = Enum.FormFactor.Custom
- rayPart.Size = Vector3.new(2, 2, distance)
- rayPart.CFrame = CFrame.new(position, gun.CFrame.p) * CFrame.new(0, 0, -distance/2)
- --add it to debris so it disappears after 0.1 seconds
- game.Debris:AddItem(rayPart, 0.1)
- garf.Touched:connect(function(p)
- if p.Parent:FindFirstChildOfClass("Humanoid") then
- p.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(5)
- end
- end)
- for i = 1,105 do
- game:GetService("RunService").Stepped:wait()
- garf.Transparency = garf.Transparency +0.01
- garf.Size = garf.Size +Vector3.new(1, 1, 1)
- explode.Size = explode.Size +Vector3.new(1, 1, 1)
- explode.Transparency = explode.Transparency +0.01
- specialmesh.Scale = specialmesh.Scale +Vector3.new(1, 1, 1)
- end
- garf:Destroy()
- explode:Destroy()
- end)
Add Comment
Please, Sign In to add comment