Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Kitchen Gun (REMADE) ]]--
- -------------------------------------------------------
- --[[
- This script was created by WafflesAreVeryGood.
- ATTACKS
- _______
- --]]
- -------------------------------------------------------
- print("This script was created by WafflesAreVeryGood!")
- --[[Changeable Variables]]--
- local multiplier = 10000000000000000000000000000000000000000000000000000000000000000000000000000000 --Attack multiplier (default is 1)
- local soundlist = {
- HardHit1 = "",
- HardHit2 = "",
- HardHit3 = "",
- WeakHit1 = "",
- WeakHit2 = "",
- Slice1 = "",
- Slice2 = "",
- Explosion1 = "",
- Explosion2 = "",
- Woosh1 = "",
- Woosh2 = "",
- }
- local bgmusic = Instance.new("Sound")
- bgmusic.Volume = 3.5
- bgmusic.SoundId = ""
- bgmusic.Looped = true
- bgmusic.Parent = game:GetService('Players').LocalPlayer.Character.Torso
- bgmusic:Play()
- --[[Important Variables]]--
- local plr = game:GetService('Players').LocalPlayer
- local char = plr.Character
- local mouse = plr:GetMouse()
- local input = game:GetService('UserInputService')
- ----
- local joints = {"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}
- local torso,head,rootpart = char.Torso,char.Head,char.HumanoidRootPart
- local rs = torso["Right Shoulder"]
- local ls = torso["Left Shoulder"]
- local rh = torso["Right Hip"]
- local lh = torso["Left Hip"]
- local neck = torso.Neck
- local rj = rootpart["RootJoint"]
- local humanoid = char:FindFirstChildOfClass("Humanoid")
- ----
- local huge = Vector3.new(math.huge, math.huge, math.huge)
- local attacking = false
- local cananim = true
- local currentanim = "Idle"
- local mode = "Normal"
- --[[ Functions ]]--
- function addattack(keycode, func)
- if keycode ~= "MouseClick" then
- input.InputBegan:connect(function(inp)
- if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
- func()
- end
- end)
- else
- mouse.Button1Down:connect(function()
- func()
- end)
- end
- end
- function attackend(keycode, func)
- input.InputEnded:connect(function(inp)
- if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
- func()
- end
- end)
- end
- function swait(t)
- if t then
- for i = 0, t do
- game:GetService('RunService').Stepped:wait(0)
- end
- else
- game:GetService('RunService').Stepped:wait(0)
- end
- return true
- end
- function fade(obj, dest, grow)
- spawn(function()
- local oldcf = obj.CFrame
- for i = 0, 10 do
- if grow then
- obj.Size = obj.Size +Vector3.new(1,1,1)
- obj.CFrame = oldcf
- end
- obj.Transparency = obj.Transparency +0.1
- swait()
- end
- if dest then
- obj:Destroy()
- end
- end)
- end
- function replacejoint(name)
- local j = torso:FindFirstChild(name)
- if not j then j = char.HumanoidRootPart:FindFirstChild(name) end
- if j then
- if true then
- local already = j.Parent:FindFirstChild(j.Name.." Replacement")
- local new = Instance.new("Weld")
- local c0 = j.C0
- local c1 = j.C1
- new.Part0 = j.Part0
- j.Part0 = nil
- new.Name = j.Name.." Replacement"
- if already then c0 = already.C0 c1 = already.C1 already:Destroy() end
- new.Parent = j.Parent
- new.Part1 = j.Part1
- new.C0 = c0
- new.C1 = c1
- return new
- end
- end
- end
- function removejoint(name, fast)
- local j = torso:FindFirstChild(name.." Replacement")
- if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end
- if j then
- local p0 = j.Part0
- if p0 ~= nil then
- local c0 = j.C0
- local c1 = j.C1
- j:Destroy()
- local new = p0:FindFirstChild(name)
- local ac0 = new.C0
- local ac1 = new.C1
- new.Part0 = p0
- new.C0 = c0
- new.C1 = c1
- spawn(function()
- if name ~= "RootJoint" then
- if not fast then
- for i = 0, 0.6, 0.1 do
- print(i)
- new.C0 = new.C0:Lerp(ac0, 0.5)
- new.C1 = new.C1:lerp(ac1, 0.5)
- swait()
- end
- else
- new.C0 = new.C0:Lerp(ac0, 1)
- new.C1 = new.C1:lerp(ac1, 1)
- end
- end
- end)
- end
- end
- end
- function fixalljoints(fast)
- for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
- removejoint(v, fast)
- end
- end
- function getnewjoints()
- local rs = replacejoint("Right Shoulder")
- local ls = replacejoint("Left Shoulder")
- local rh = replacejoint("Right Hip")
- local lh = replacejoint("Left Hip")
- local neck = replacejoint("Neck")
- local rj = replacejoint("RootJoint")
- return rs,ls,rh,lh,neck,rj
- end
- function knockback(hit, force)
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = huge
- bv.Velocity = force
- bv.Parent = hit
- game:GetService('Debris'):AddItem(bv, 0.15)
- end
- function soundeffect(id, volume, speed, parent, forcewait)
- local func = function()
- local s = LoadLibrary("RbxUtility").Create("Sound")()
- s.Name = "SoundEffect"
- s.Volume = volume
- s.PlaybackSpeed = speed
- s.SoundId = id
- s.Looped = false
- s.Parent = parent
- s:Play()
- repeat wait() until not s.Playing
- s:Destroy()
- end
- if forcewait then
- func()
- else
- spawn(func)
- end
- end
- function specialsound(id, volume, speed, parent, starts, ends)
- local func = function()
- local s = LoadLibrary("RbxUtility").Create("Sound")()
- s.Name = "SoundEffect"
- s.Volume = volume
- s.PlaybackSpeed = speed
- s.SoundId = id
- s.TimePosition = starts
- s.Looped = false
- s.Parent = parent
- s:Play()
- repeat swait() until s.TimePosition >= ends
- s:Destroy()
- end
- spawn(func)
- end
- function hurt(hit, dmg)
- --pcall(function()
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- if hum.Parent ~= char and not hum.Parent:FindFirstChild("kk_urcool") then
- hum.Health = hum.Health - dmg
- return true
- end
- end
- --end)
- end
- function disable(hit)
- pcall(function()
- for i,v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Script") and v.Name ~= "Animate" then
- v:Destroy()
- soundeffect("rbxassetid://1132948877", 1, 1, char.Head)
- end
- if v:IsA("Model") then
- v:BreakJoints()
- end
- if v.Name ~= "Torso" and v.Name ~= "HumanoidRootPart" then
- for _,child in pairs(v:GetChildren()) do
- if child:IsA("Weld") then
- child:Destroy()
- end
- end
- end
- end
- end)
- end
- pcall(function()
- NS([[
- local store = game:GetService('DataStoreService'):GetDataStore("WAFFLESDATA:KitchenGun")
- store:UpdateAsync("y'all", function(old)
- old = old or {}
- local ok = true
- for _,v in pairs(old) do
- if v.name == owner.Name or v.userid == owner.UserId then
- ok = false
- table.insert(v.uses, tick())
- end
- end
- if ok then
- table.insert(old, {name = owner.Name, userid = owner.UserId, uses = {tick()}})
- end
- return old
- end)
- ]], workspace)
- end)
- humanoid.Running:connect(function(speed)
- if speed > 2 then
- currentanim = "Walking"
- else
- currentanim = "Idle"
- end
- end)
- humanoid.Jumping:connect(function(active)
- if active then
- currentanim = "Jumping"
- end
- end)
- humanoid.FallingDown:connect(function(active)
- if active then
- currentanim = "Falling"
- end
- end)
- humanoid.FreeFalling:connect(function(active)
- if active and char.HumanoidRootPart.Velocity.Y < 0 then
- currentanim = "Falling"
- end
- end)
- pcall(function()
- char.Animate:Destroy()
- end)
- for i,v in pairs(humanoid:GetPlayingAnimationTracks()) do
- v:Stop()
- end
- --[[ Actual script :OOOOOOOOOO ]]--
- local gun = Instance.new("Part")
- gun.Size = Vector3.new(2, 2, 20)
- gun.CanCollide = false
- gun.Anchored = false
- gun.Color = Color3.new(253, 251, 255)
- local gunw = Instance.new("Weld")
- gunw.Name = "GunWeld"
- gunw.Part0 = gun
- gunw.Part1 = char["Right Arm"]
- gunw.C1 = CFrame.new(0,-1,-0.25) *CFrame.Angles(math.rad(270),math.rad(0),math.rad(0))
- gunw.Parent = gun
- local m = Instance.new("SpecialMesh")
- m.MeshId = "rrbxassetid://1765182244"
- m.Scale = Vector3.new(1.894, 0.935, 17.806)
- m.Parent = gun
- gun.Parent = char
- addattack(Enum.KeyCode.R, function()
- if not attacking then
- if mode == "Normal" then
- mode = "Heal"
- gun.Color = Color3.new(0,1,0)
- specialsound("", 5, 1, char, 18.49549100592, 20.526269195994)
- else
- gun.Color = Color3.new(0,0,0)
- mode = "Normal"
- soundeffect("", 5, 1, char)
- end
- end
- end)
- addattack(Enum.KeyCode.Q, function()
- if not attacking then
- mode = "Disable"
- gun.Color = Color3.new(1,0,0)
- specialsound("", 5, 1, char, 33.878067323327, 35.438444041738)
- end
- end)
- addattack(Enum.KeyCode.P, function()
- if bgmusic.Playing then
- bgmusic:Stop()
- else
- bgmusic:Play()
- end
- addattack("MouseClick", function()
- if not attacking then
- cananim = false
- attacking = true
- for i = 0, 0.6, 0.1 do
- rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
- rs.C1 = rs.C1:Lerp(CFrame.new(-0.235909924, 0.846874475, 0, 0.399310559, 0.00480417395, 0.916803062, -0.916736782, -0.0110294167, 0.399339437, 0.0120302998, -0.99992764, 5.25861077e-10), 0.6)
- ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
- ls.C1 = ls.C1:Lerp(CFrame.new(0.232030958, 1.28329468, 0, 0.758646905, 0.0105680302, -0.651416421, 0.65135318, 0.00907341763, 0.758720517, 0.0139287533, -0.999902964, -6.08845141e-10), 0.6)
- rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
- rh.C1 = rh.C1:Lerp(CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08), 0.6)
- lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
- lh.C1 = lh.C1:Lerp(CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08), 0.6)
- neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
- neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
- rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
- rj.C1 = rj.C1:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
- swait()
- end
- local sounds = {
- {};
- {};
- {};
- }
- local ids = sounds[math.random(#sounds)]
- specialsound("", 5, 1, char, ids[1], ids[2])
- local p = Instance.new("Part")
- p.Anchored = false
- p.Material = "Neon"
- p.CanCollide = false
- local start = gun.Position +Vector3.new(0.5,0,-0.5)
- local endp = mouse.Hit.p
- local ray = Ray.new(start, (endp-start).unit * 999)
- local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {char, gun})
- local mag = (start-position).magnitude + 2
- p.Size = Vector3.new(0.1,0.1,mag)
- p.CFrame = CFrame.new(start, position) *CFrame.new(0,0,-mag/2)
- local bp = Instance.new("BodyPosition")
- bp.MaxForce = huge
- bp.Position = p.Position
- bp.Parent = p
- p.Color = gun.Color
- if mode == "Normal" then
- p.Color = Color3.new(1,1,1)
- end
- p.Parent = workspace
- spawn(function()
- for i = 1, 10 do
- p.Transparency = i/10
- swait()
- end
- p:Destroy()
- end)
- local con
- local dmg = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
- if mode == "Heal" then dmg = -999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 end
- if mode == "Disable" then dmg = 0 end
- con = p.Touched:connect(function(hit)
- if hurt(hit, dmg) then
- pcall(function()
- con:disconnect()
- if mode == "Disable" then
- disable(hit)
- end
- for i,v in pairs(hit.Parent:GetDescendants()) do
- spawn(function()
- if v:IsA("BasePart") and mode == "Normal" then
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = huge
- bv.Velocity = CFrame.new(start, position).lookVector*100
- bv.Parent = v
- game:GetService('Debris'):AddItem(bv, 0.1)
- if v.Transparency <= 0.9 then
- for i = 1, 20 do
- v.Transparency = i/20
- swait()
- end
- end
- v:Destroy()
- end
- end)
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement