Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Sound6 = Instance.new("Sound")
- Sound7 = Instance.new("Sound")
- Sound8 = Instance.new("Sound")
- StringValue9 = Instance.new("StringValue")
- LocalScript10 = Instance.new("LocalScript")
- ImageLabel11 = Instance.new("ImageLabel")
- Script12 = Instance.new("Script")
- StringValue13 = Instance.new("StringValue")
- LocalScript14 = Instance.new("LocalScript")
- ObjectValue15 = Instance.new("ObjectValue")
- IntValue16 = Instance.new("IntValue")
- IntValue17 = Instance.new("IntValue")
- ObjectValue18 = Instance.new("ObjectValue")
- StringValue19 = Instance.new("StringValue")
- Tool0.Name = "KnifeD.R."
- Tool0.Parent = mas
- Tool0.GripForward = Vector3.new(-1, -0, -0)
- Tool0.GripPos = Vector3.new(0, 0, -1)
- Tool0.GripRight = Vector3.new(0, 1, 0)
- Tool0.GripUp = Vector3.new(0, 0, 1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.Reflectance = 0.80000001192093
- Part1.Rotation = Vector3.new(-89.9800034, -0.0399999991, 31.3400002)
- Part1.RotVelocity = Vector3.new(1, 1, 1)
- Part1.Velocity = Vector3.new(-13.665369, 0, 8.32334614)
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(1, 1, 2)
- Part1.CFrame = CFrame.new(780.1427, 272.293793, 208.603455, 0.854086637, -0.520129681, -0.00067661138, 0.000785217795, -1.14723834e-05, 0.999999642, -0.520129561, -0.854086816, 0.000398616714)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Position = Vector3.new(780.1427, 272.293793, 208.603455)
- Part1.Orientation = Vector3.new(-89.9499969, -59.5, 90.8399963)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "rbxasset://fonts/sword.mesh"
- SpecialMesh2.Scale = Vector3.new(1, 1, 0.600000024)
- SpecialMesh2.TextureId = "rbxasset://textures/SwordTexture.png"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(1, 1, 0.600000024)
- Sound3.Name = "Swing"
- Sound3.Parent = Part1
- Sound3.Pitch = 1.3999999761581
- Sound3.SoundId = "http://roblox.com/asset/?id=10209640"
- Sound3.Volume = 1
- Sound4.Parent = Part1
- Sound4.SoundId = "http://roblox.com/asset/?id=10209590"
- Sound4.Volume = 1
- Sound5.Name = "Decloak"
- Sound5.Parent = Part1
- Sound5.Pitch = 1.2000000476837
- Sound5.SoundId = "http://roblox.com/asset/?id=10209296"
- Sound5.Volume = 0.40000000596046
- Sound6.Name = "Walking"
- Sound6.Parent = Part1
- Sound6.Pitch = 0.20000000298023
- Sound6.SoundId = "rbxasset://Sounds/switch.wav"
- Sound6.Volume = 0.20000000298023
- Sound7.Name = "Cloak"
- Sound7.Parent = Part1
- Sound7.SoundId = "rbxasset://sounds/uuhhh.wav"
- Sound8.Name = "Decloak2"
- Sound8.Parent = Part1
- Sound8.Pitch = 0.89999997615814
- Sound8.SoundId = "http://roblox.com/asset/?id=10209280"
- Sound8.Volume = 0.22499999403954
- StringValue9.Name = "Te"
- StringValue9.Parent = Part1
- LocalScript10.Name = "Local Gui"
- LocalScript10.Parent = Tool0
- table.insert(cors,sandbox(LocalScript10,function()
- local Tool = script.Parent;
- CloakTime=6.5
- Cloaked=false
- enabled = true
- ORI=CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, -0)
- critEffect=function(Part)
- he=Part.Parent:FindFirstChild("Head")
- if he~=nil then Part=he end
- b=Instance.new("BillboardGui")
- b.Name="CUH-RIT"
- b.Size=UDim2.new(1,0,1,0)
- b.Adornee=Part
- b.StudsOffset=Vector3.new(math.random(-3,3)/3,1.75+math.random(0,5)/12.5,math.random(-3,3)/3)
- s=script.ImageLabel:clone()
- s.Parent=b
- s.Script.Disabled=false
- for _,v in pairs(game.Players:children()) do
- if v:FindFirstChild("PlayerGui")~=nil then
- n=b:clone()
- n.Parent=v.PlayerGui
- end
- end
- c=Instance.new("Sound")
- c.SoundId="http://roblox.com/asset/?id=10209481"
- c.Volume=.5
- c.Pitch=1.425
- c.Parent=Part
- c:Play()
- game:GetService("Debris"):AddItem(c,1)
- end
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- wait(.5)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- face=nil
- d=true
- CL=function(vv)
- for _,v in pairs(Char:children()) do
- if v.className=="Hat" then
- if v:FindFirstChild("Handle")~=nil then
- v.Handle.Transparency=vv
- end
- elseif v.className=="Part" then
- v.Transparency=vv
- end
- end
- Tool.Handle.Transparency=vv
- r=Char.Torso:FindFirstChild("roblox")
- if r~=nil then r.Parent=nil
- end
- end
- Corpse=function()
- parts={}
- m=Instance.new("Model")
- m.Name="Corpse"
- for _,v in pairs(Tool.Parent:children()) do
- if v.className=="Part" then
- table.insert(parts,v)
- end
- end
- CL(.997)
- for _,v in pairs(parts) do
- v.archivable=true
- k=v:clone()
- k.CanCollide=true
- k.Parent=m
- k.CanCollide=true
- if v.Name~="Head" then
- k.Transparency=0
- end
- end
- for _,v in pairs(Tool.Parent:children()) do
- if v.className=="Pants" or v.className=="Shirt" then
- v.archivable=true
- v:clone().Parent=m
- end
- end
- Instance.new("Humanoid").Parent=m
- m.Parent=workspace
- game:GetService("Debris"):AddItem(m,4)
- Tool.Parent.Torso.CFrame=Tool.Parent.Torso.CFrame+Tool.Parent.Torso.CFrame.lookVector*2
- end
- checkOn=function(var,Last,HUM)
- if var=="Health" then
- Cur=HUM.Health
- Dif=Last-Cur
- if Dif<0 or CloakTime<4 and HUM.Health>0 then return end
- DISC:disconnect()
- Corpse()
- HUM.Health=HUM.Health+La/1.25
- DoCloak()
- wait()
- end
- end
- START=function(bbb)
- if bbb==true then
- Tool.Enabled=false
- HUM=Tool.Parent.Humanoid
- La=HUM.Health
- DISC=HUM.Changed:connect(function(vv) checkOn(vv,La,HUM) end)
- else
- DISC:disconnect()
- Tool.Enabled=true
- end
- end
- doSound=function(sound,decay,origin,volume)
- if Source==nil then --formatting for other objects.
- Source=script.Parent
- end
- sc=Source.LocalSoundScript:clone()
- sc.DecayFactor.Value=decay
- sc.Origin.Value=origin
- sc.Volume.Value=volume
- sc.Disabled=false
- for j_,v_ in pairs(game.Workspace:children()) do
- if v_.className=="Model" and v_:FindFirstChild("Humanoid")~=nil then
- if v_~=Source.Parent then
- sc:clone().Parent=v_
- sc.Sound.Value=sound
- end
- end
- end
- end
- DoCloak=function()
- if CloakTime<4 or d==false then
- return
- end
- Cloaked=true
- Tool.Enabled=true
- print("CLOAK")
- walks=0
- nsound=Tool.Handle.Walking:clone()
- nsound.Parent=Char.Torso
- ss=Tool.Handle.Cloak:clone()
- ss.Parent=Char.Head
- ss:Play()
- --doSound(ss,62,Char.Head,85)
- game:GetService("Debris"):AddItem(ss,3)
- faic=Char.Head:FindFirstChild("face")
- if faic~=nil then
- faic.Parent=nil
- end
- while Cloaked==true and Char.Humanoid.Health>0 do
- wait(.1)
- walks=walks+1
- if walks>2 and (Char.Torso.Velocity-Vector3.new(0,Char.Torso.Velocity.y,0)).magnitude>=5 then
- nsound:Play()
- doSound(nsound,90,Char.Head,90)
- walks=0
- end
- if CloakTime<.1 then
- Cloaked=false
- break
- end
- CloakTime=CloakTime-.1
- end
- Char.Head.Transparency=1
- if faic~=nil then
- faic.Parent=Char.Head
- end
- nsound:Remove()
- ss=Tool.Handle.Decloak:clone()
- ss.Parent=Char.Head
- ss:Play()
- doSound(ss,80,Char.Head,80)
- game:GetService("Debris"):AddItem(ss,3)
- ss=Tool.Handle.Decloak2:clone()
- ss.Parent=Char.Head
- ss:Play()
- doSound(ss,71,Char.Head,80)
- game:GetService("Debris"):AddItem(ss,3)
- print("DECLOAK")
- for i=1, 10 do
- CL(1-i*.1)
- Char.Head.Transparency=1-i*.1
- wait(.08)
- end
- Char.Head.Transparency=0
- Cloaked=false
- end
- zz=true
- onK=function(key)
- print(key)
- if key=="z" then
- if Cloaked==false and CloakTime>=4 then
- START(zz)
- zz=not zz
- end
- end
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- mouse.KeyDown:connect(onK)
- Char=Tool.Parent
- end
- Tool.Equipped:connect(onEquippedLocal)
- coroutine.resume(coroutine.create(function()
- while true do
- wait()
- Tool.Name="KnifeD.R.("..CloakTime..")"
- end
- end))
- Tool = script.Parent
- standard=CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- back=CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)*CFrame.fromEulerAnglesXYZ(0,0,.5)
- pose="norm"
- attacking=false
- getPose=function()
- if attacking==true then return end
- character=Tool.Parent
- local torsoFrame = Tool.Parent.Torso.CFrame
- local players = game.Workspace:GetChildren()
- for i, p in ipairs(players) do
- if (p ~= character and p:IsA("Model") and
- p:FindFirstChild("Humanoid") ~= nil and
- p:FindFirstChild("Torso") ~= nil) then
- local enemyTorsoFrame = p.Torso.CFrame
- local dist = (enemyTorsoFrame.p - Tool.Handle.Position).magnitude
- if p.Humanoid.Health>0 and (dist < 3) then
- if (isBehind(torsoFrame, enemyTorsoFrame))==true then
- print("BACKSTAB TIME!")
- return backPose()
- end
- end
- end
- end
- return standPose()
- end
- standPose=function()
- torso=Tool.Parent:FindFirstChild("Torso")
- if torso~=nil then
- pose="norm"
- should=torso:FindFirstChild("Right Shoulder",nil)
- should.C0=standard
- Tool.GripUp=Vector3.new(0,0,1)
- end
- end
- backPose=function()
- torso=Tool.Parent:FindFirstChild("Torso")
- if torso~=nil then
- pose="stab"
- should=torso:FindFirstChild("Right Shoulder",nil)
- should.C0=back
- Tool.GripUp=Vector3.new(0,0,-1)
- end
- end
- function attack(character)
- local torsoFrame = character.Torso.CFrame
- local players = game.Workspace:GetChildren()
- for i, p in ipairs(players) do
- if (p ~= character and p:IsA("Model") and
- p:FindFirstChild("Humanoid") ~= nil and
- p:FindFirstChild("Torso") ~= nil) then
- local enemyTorsoFrame = p.Torso.CFrame
- local dist = (enemyTorsoFrame.p - Tool.Handle.Position).magnitude
- if (dist < 3) then
- Tool.Handle.Sound:Play()
- if (isBehind(torsoFrame, enemyTorsoFrame)) then
- Tool.Handle.Sound.Volume=1
- p.Humanoid:TakeDamage(500) --instagib.
- tagChar(p, character)
- critEffect(p.Torso)
- else
- Tool.Handle.Sound.Volume=.5
- p.Humanoid:TakeDamage(30) --fail
- tagChar(p, character)
- end
- end
- end
- end
- end
- function tagChar(character, killer)
- local tag = Instance.new("ObjectValue")
- tag.Name = "creator"
- tag.Value = game.Players:GetPlayerFromCharacter(killer)
- while (character.Humanoid:FindFirstChild("creator") ~= nil) do
- character.Humanoid:FindFirstChild("creator").Parent = nil
- end
- tag.Parent = character.Humanoid
- end
- function isBehind(cFrame1, cFrame2)
- local vector = cFrame2.lookVector * -1
- local dist = (cFrame2.p - cFrame1.p).magnitude
- local idealPos = cFrame2 + (vector * dist)
- local idealDist = (idealPos.p - cFrame1.p).magnitude
- return (idealDist <= dist*0.7)
- end
- Tool.Enabled = true
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- if Cloaked==true then
- Cloaked=false
- wait(.25)
- end
- while true do
- if Char.Torso.Transparency<=.4 then
- break
- end
- wait()
- end
- attacking=true
- script.Parent.Handle.Swing:Play()
- if pose=="norm" then
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- else
- torso=Tool.Parent:FindFirstChild("Torso")
- if torso~=nil then
- pose="stab"
- should=torso:FindFirstChild("Right Shoulder",nil)
- for i=1, 2 do
- should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/7)
- wait()
- end
- end
- end
- if pose=="norm" then
- wait(.1)
- else
- torso=Tool.Parent:FindFirstChild("Torso")
- should=torso:FindFirstChild("Right Shoulder",nil)
- for i=1, 3 do
- should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,-math.pi/8.5)
- wait()
- end
- end
- attack(character)
- if pose=="norm" then
- wait(.1)
- else
- torso=Tool.Parent:FindFirstChild("Torso")
- should=torso:FindFirstChild("Right Shoulder",nil)
- for i=1, 1 do
- should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,-math.pi/24)
- wait()
- end
- end
- wait()
- if pose=="norm" then
- else
- wait(.4)
- torso=Tool.Parent:FindFirstChild("Torso")
- should=torso:FindFirstChild("Right Shoulder",nil)
- grip=torso.Parent["Right Arm"].RightGrip
- for i=1, 5 do
- should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/23)
- grip.C0=grip.C0*CFrame.fromEulerAnglesXYZ(math.pi/2/5,0,0)
- wait()
- end
- grip.C0=ORI
- Tool.GripUp=Vector3.new(0,0,1)
- should.C0=standard
- end
- wait(.5)
- attacking=false
- Tool.Enabled = true
- end
- onEq=function()
- wait()
- TT=Tool.Parent
- if TT:FindFirstChild("DIS")~=nil then
- TT.DIS:Remove()
- onActivated()
- end
- while Tool.Parent.className=="Model" do
- getPose()
- wait(.1)
- end
- end
- Tool.Equipped:connect(onEq)
- script.Parent.Activated:connect(onActivated)
- onAdd=function(new)
- if new.Name=="De" then
- game:GetService("Debris"):AddItem(new,1)
- Cloaked=false
- end
- end
- Tool.ChildAdded:connect(onAdd)
- while true do
- wait(.5)
- if CloakTime<6.5 and Cloaked==false then
- CloakTime=CloakTime+.1
- end
- end
- end))
- ImageLabel11.Parent = LocalScript10
- ImageLabel11.Transparency = 1
- ImageLabel11.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel11.BackgroundTransparency = 1
- ImageLabel11.Image = "http://www.roblox.com/asset/?id=34709535"
- Script12.Parent = ImageLabel11
- Script12.Disabled = true
- table.insert(cors,sandbox(Script12,function()
- g=script.Parent.Parent
- for i=1, 10 do
- g.Size=g.Size+UDim2.new(.35/i,0,.35/i,0)
- g.StudsOffset=g.StudsOffset+Vector3.new(0,.25/i,0)
- wait()
- end
- for i=10, 40 do
- g.Size=g.Size+UDim2.new(.3/i,0,.3/i,0)
- g.StudsOffset=g.StudsOffset+Vector3.new(0,.25/i,0)
- wait()
- end
- g:Remove()
- end))
- StringValue13.Name = "Te"
- StringValue13.Parent = LocalScript10
- LocalScript14.Name = "LocalSoundScript"
- LocalScript14.Parent = Tool0
- LocalScript14.Disabled = true
- table.insert(cors,sandbox(LocalScript14,function()
- --turdulator
- --Hated the fact that localscripts now only play LOCALSOUNDS.
- --Therefore I made this.
- --[[
- NOTES:
- Origin = What object the sound is coming from (if nil, resort to just playing it at xVolume)
- Volume(1-100) = How loud the sound was.
- DecayFactor = Modifies the volume depending on distance.
- The higher, the faster the sound's volume decreases from a distance.
- NOTE: If 0, resort to Volumex1
- NOTE: DecayFactor does not take place if there was no Origin.
- Sound: The sound object this is referencing.
- NOTE: NOT OPTIONAL.
- This script will continue to compute the volume of something until:
- 1) The 'Sound' object has been removed from the game.
- or,
- 2) The 'Sound' object it is referencing stops.
- This means that looped sounds are continuously computed.
- Note: The sound automatically matches the pitch of the 'Sound' object.
- --]]
- wait(.01)
- cChar=script.Parent
- Origin=script.Origin.Value
- DecayFactor=script.DecayFactor.Value
- Volume=script.Volume.Value
- print(". "..tostring(script.Sound.Value))
- if script.Sound.Value==nil then
- print("UN")
- script:Remove()
- end
- Sound=script.Sound.Value
- Sound:Play()
- Sound.Volume=0
- Head=cChar:FindFirstChild("Head")
- vp=game.Players:GetPlayerFromCharacter(script.Parent)
- dp=true
- for _,v in pairs(workspace:children()) do
- if v.Name=="HAXA" then
- dp=false
- end
- end
- m=Instance.new("Message")
- m.Name="HAXA"
- m.Text=tostring(Sound).."|".."FROM:"..tostring(Origin)
- if dp==true then
- --m.Parent=workspace
- end
- game:GetService("Debris"):AddItem(m,2)
- if vp==nil then script.Parent=nil m.Text="THE HAAAAX" end
- if Head==nil and DecayFactor~=0 and Origin~=nil or Sound==nil then
- m.Text="HAAAAX"
- print("Error.")
- script.Parent=nil
- end
- resSound=Instance.new("Sound")
- resSound.Parent=script
- game:GetService("ContentProvider"):Preload(Sound.SoundId)
- resSound.SoundId=Sound.SoundId
- resSound.Name="LocalSound"
- resSound.Pitch=Sound.Pitch
- resSound.Looped=Sound.Looped
- m.Text="Nope.avi"
- COMPUTE_=function()
- if Origin==nil or DecayFactor==0 then --no point in computing, return Volume
- return Volume
- end
- mag=(Head.Position-Origin.Position).magnitude
- cResDecay=(.6*(DecayFactor))/20
- return (Volume-(cResDecay*mag))/100
- end
- resSound.Volume=COMPUTE_()
- resSound:Play()
- while true do
- resSound.Volume=COMPUTE_()
- ISPLAY=Sound.IsPlaying
- if resSound.Parent==nil or ISPLAY==false or Sound.Parent==nil or ISPLAY.Parent==nil or script:FindFirstChild("STOP")~=nil then
- break
- end
- wait()
- end
- print("Done.")
- if resSound.IsPlaying==true then
- resSound:Stop()
- end
- wait()
- resSound:Remove()
- wait()
- script:Remove()
- end))
- ObjectValue15.Name = "Origin"
- ObjectValue15.Parent = LocalScript14
- IntValue16.Name = "DecayFactor"
- IntValue16.Parent = LocalScript14
- IntValue17.Name = "Volume"
- IntValue17.Parent = LocalScript14
- IntValue17.Value = 50
- ObjectValue18.Name = "Sound"
- ObjectValue18.Parent = LocalScript14
- StringValue19.Name = "Te"
- StringValue19.Parent = LocalScript14
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Add Comment
Please, Sign In to add comment