Advertisement
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")
- Sound2 = Instance.new("Sound")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- SpecialMesh6 = Instance.new("SpecialMesh")
- Sparkles7 = Instance.new("Sparkles")
- Sparkles8 = Instance.new("Sparkles")
- Sparkles9 = Instance.new("Sparkles")
- Sparkles10 = Instance.new("Sparkles")
- Fire11 = Instance.new("Fire")
- Sound12 = Instance.new("Sound")
- LocalScript13 = Instance.new("LocalScript")
- Script14 = Instance.new("Script")
- Animation15 = Instance.new("Animation")
- Animation16 = Instance.new("Animation")
- Animation17 = Instance.new("Animation")
- Animation18 = Instance.new("Animation")
- LocalScript19 = Instance.new("LocalScript")
- Script20 = Instance.new("Script")
- Tool0.Name = "rainbow"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=72541473"
- Tool0.Grip = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0)
- Tool0.GripForward = Vector3.new(-1, -0, -0)
- Tool0.GripPos = Vector3.new(0, 0, -1.70000005)
- Tool0.GripRight = Vector3.new(0, 1, 0)
- Tool0.GripUp = Vector3.new(0, 0, 1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(-221.490738, 62.8512993, 444.01767, 8.53538513e-05, 0.507240474, 0.861804485, -0.99999994, 0.000165462494, 1.60932541e-06, -0.000141739845, -0.861804485, 0.507240534)
- Part1.Orientation = Vector3.new(0, 59.5200005, -89.9899979)
- Part1.Position = Vector3.new(-221.490738, 62.8512993, 444.01767)
- Part1.Rotation = Vector3.new(0, 59.5200005, -89.9899979)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Size = Vector3.new(1, 0.800000012, 6)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.Reflectance = 0.40000000596046
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Dark stone grey")
- Part1.FormFactor = Enum.FormFactor.Plate
- Part1.formFactor = Enum.FormFactor.Plate
- Sound2.Name = "SOUND_slash"
- Sound2.Parent = Part1
- Sound2.SoundId = "rbxassetid://722744682"
- Sound3.Name = "SOUND_equip"
- Sound3.Parent = Part1
- Sound3.SoundId = "rbxassetid://132073439"
- Sound3.Volume = 10
- Sound4.Name = "SOUND_down"
- Sound4.Parent = Part1
- Sound4.SoundId = "rbxassetid://130781643"
- Sound4.Volume = 10
- Sound5.Name = "SOUND_hitground"
- Sound5.Parent = Part1
- Sound5.SoundId = "rbxassetid://618667795"
- Sound5.Volume = 10
- SpecialMesh6.Parent = Part1
- SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=15924243"
- SpecialMesh6.Scale = Vector3.new(1.20000005, 1, 1.20000005)
- SpecialMesh6.TextureId = "http://www.roblox.com/asset/?id=836795717"
- SpecialMesh6.MeshType = Enum.MeshType.FileMesh
- Sparkles7.Parent = Part1
- Sparkles8.Parent = Part1
- Sparkles8.Color = Color3.new(1.77083, 3.4, 0)
- Sparkles8.SparkleColor = Color3.new(1, 0.333333, 0)
- Sparkles9.Parent = Part1
- Sparkles9.Color = Color3.new(1.18056, 10.2, 1)
- Sparkles9.SparkleColor = Color3.new(0.666667, 1, 1)
- Sparkles10.Parent = Part1
- Sparkles10.Color = Color3.new(1.77083, 9.48, 0.145098)
- Sparkles10.SparkleColor = Color3.new(1, 0.929412, 0.145098)
- Fire11.Parent = Part1
- Fire11.Color = Color3.new(1, 0, 0)
- Fire11.Heat = 14
- Sound12.Name = "Rainbow"
- Sound12.Parent = Part1
- Sound12.Looped = true
- Sound12.Playing = true
- Sound12.SoundId = "rbxassetid://719818409"
- Sound12.Volume = 2
- LocalScript13.Name = "ChristmasKatana_MainScript"
- LocalScript13.Parent = Tool0
- table.insert(cors,sandbox(LocalScript13,function()
- --local mDebugId = game.Workspace.DebugId.Value
- --game.Workspace.DebugId.Value = game.Workspace.DebugId.Value+1
- --print("Running swordscript <"..mDebugId..">")
- local debris = game:GetService("Debris")
- -------------------------------------
- -- Makes an RBX::Lua Instance using
- -- a table of key-value pairs to
- -- initialize it. Values with numeric
- -- keys will be parented to the object
- -- and other values will be set
- -- as members of the object.
- function Create(ty)
- return function(data)
- local obj = Instance.new(ty)
- for k, v in pairs(data) do
- if type(k) == 'number' then
- v.Parent = obj
- else
- obj[k] = v
- end
- end
- return obj
- end
- end
- ---------------------------------------
- -- Same as Make, but modifies an existing
- -- object rather than creating ones.
- function Modify(obj, data)
- for k, v in pairs(data) do
- if type(data) == 'number' then
- data.Parent = obj
- else
- data[k] = v
- end
- end
- return obj
- end
- -----------------------------------------
- -- Creates a class which can be instantiated
- -- using `CreateCLASSNAME( ... )`.
- ---usage:
- --class'MyClass'(function(this, arg1)
- -- this.ClassMember = value
- -- function this.ClassMethod(...) ... end
- --end, function(def)
- -- def.StaticMember = value
- -- function def.StaticMethod(...) ... end
- --end)
- --local obj = CreateMyClass(arg1)
- ------------------------------------------
- local function class(name)
- local def = {}
- getfenv(0)[name] = def
- return function(ctor, static)
- local nctor = function(...)
- local this = {}
- if ctor then
- ctor(this, ...)
- end
- return this
- end
- getfenv(0)['Create'..name] = nctor
- if static then static(def) end
- end
- end
- ---------------------------------------------
- -- Signal class for custom-made events
- --API:
- -- Signal:connect(callback)
- -- Signal:fire(...)
- -- Signal:wait()
- ---------------------------------------------
- class'Signal'(function(this)
- local mListeners = {}
- local mWaitObject = Create'BoolValue'{}
- function this:connect(func)
- local connection = {}
- function connection:disconnect()
- mListeners[func] = nil
- end
- mListeners[func] = connection
- return connection
- end
- function this:fire(...)
- --print("Fire evt<"..tostring(this).."> from script<"..mDebugId..">")
- for func, conn in pairs(mListeners) do
- --print("-> "..tostring(func).."( ... )")
- func(...)
- end
- mWaitObject.Value = not mWaitObject.Value
- end
- function this:wait()
- mWaitObject.Changed:wait()
- end
- end)
- --------------------------------------------------
- -- Bin class for cleaning up assets
- --API:
- -- Bin:add(func: Function, ident: String)
- -- Bin:clean(ident: String)
- -- Bin:cleanAll()
- --------------------------------------------------
- class'Bin'(function(this)
- local mGarbage = {}
- function this:add(func, ident)
- ident = ident or '__unnamed'
- if not mGarbage[ident] then
- mGarbage[ident] = {}
- end
- mGarbage[ident][#mGarbage[ident]+1] = func
- end
- function this:clean(ident)
- local listToCall = mGarbage[ident]
- if listToCall then
- for _, func in pairs(listToCall) do
- func()
- end
- mGarbage[ident] = nil
- end
- end
- function this:cleanAll()
- for ident, list in pairs(mGarbage) do
- for _, func in pairs(list) do
- func()
- end
- mGarbage[ident] = nil
- end
- end
- end)
- -----------------------------------------------------
- -- AnimationProvider class for easy loading of
- -- animation assets into animationtracks once
- -- a humanoid is available.
- --API:
- -- AnimationProvider:registerAnimation(ident, assetid)
- -- AnimationProvider:setHumanoid(humanoid)
- -- AnimationProvider:setTool(tool)
- -- AnimationProvider:getAnimation(ident)
- -----------------------------------------------------
- class'AnimationProvider'(function(this)
- local mAnimations = {--[[ident => {AnimationId, CurrentTrack, CurrentAnim} ]]}
- local mCurrentHumanoid = nil
- function this:registerAnimation(ident, assetid)
- --check for an existing copy of the anim
- local existingAnim = Tool.Tool:FindFirstChild('ANIM_'..ident)
- --make the data for this anim
- local animdat = {
- AnimationId = assetid,
- CurrentAnim = existingAnim or Create'Animation'{
- Name = "ANIM_"..ident,
- AnimationId = assetid,
- },
- }
- mAnimations[ident] = animdat
- --if there's a current tool, put it in there
- if Tool.Tool then
- Tool.HUGE_EQUIP_HACK = true
- animdat.CurrentAnim.Parent = Tool.Tool
- Tool.HUGE_EQUIP_HACK = false
- end
- --if there's a humanoid load the animation track
- if mCurrentHumanoid then
- animdat.CurrentTrack = mCurrentHumanoid:LoadAnimation(animdat.CurrentAnim)
- end
- end
- function this:setHumanoid(humanoid)
- mCurrentHumanoid = humanoid
- for _, anim in pairs(mAnimations) do
- anim.CurrentTrack = humanoid:LoadAnimation(anim.CurrentAnim)
- end
- end
- function this:getAnimation(ident)
- local dat = mAnimations[ident]
- if not dat then error("Gear Fatal Error: Animation `"..ident.."` not found") end
- if not dat.CurrentTrack then
- error("Gear Fatal Error: No Humanoid for animation `"..ident.."` to run in")
- end
- return dat.CurrentTrack
- end
- end)
- ----------------------------------------------
- -- SoundProvider class
- -- functions similarily to the animationprovider
- ----------------------------------------------
- class'SoundProvider'(function(this)
- local mSounds = {}
- function this:registerSound(ident, assetid, inpart)
- inpart = inpart or Tool.Tool:FindFirstChild('Handle')
- if not inpart then
- repeat
- inpart = Tool.Tool.ChildAdded:wait()
- until inpart.Name == 'Handle'
- end
- local existingSound = inpart:FindFirstChild('SOUND_'..ident)
- local sounddat = {
- SoundId = assetid,
- CurrentSound = existingSound or Create'Sound'{
- Name = 'SOUND_'..ident,
- SoundId = assetid,
- Parent = inpart,
- },
- }
- mSounds[ident] = sounddat
- end
- function this:getSound(ident)
- local dat = mSounds[ident]
- if dat then
- return dat.CurrentSound
- end
- end
- end)
- ----------------------------------------------
- -- DebounceProvider class -- Prevent events
- -- from happening in too rapid succession
- ----------------------------------------------
- class'DebounceProvider'(function(this)
- local mFlagNameToLastTime = {}
- function this:test(ident, delta)
- local t = tick()
- local lastTime = mFlagNameToLastTime[ident] or 0
- if delta then
- return (t-lastTime) > delta
- else
- return mFlagNameToLastTime[ident]
- end
- end
- function this:set(ident, state)
- if state then
- mFlagNameToLastTime[ident] = state
- elseif state == false then
- mFlagNameToLastTime[ident] = false
- else
- mFlagNameToLastTime[ident] = tick()
- end
- end
- end)
- function TagHumanoid(humanoid)
- if Tool.Player then
- local tag = Create'ObjectValue'{
- Name = "creator",
- Value = Tool.Player,
- Parent = humanoid,
- }
- Tool.Bin:add(function()
- tag:Remove()
- end, 'HumanoidTag')
- end
- end
- function UntagHumanoid()
- Tool.Bin:clean('HumanoidTag')
- end
- ------- wait for any event in a set of events to fire ------
- function WaitForAny(tb)
- local evt = tb
- local conn = {}
- local eventargs = nil
- local waitProxy = Create'BoolValue'{}
- for _, e in pairs(evt) do
- local c = e:connect(function(...)
- for _, c in pairs(conn) do
- c:disconnect()
- end
- eventargs = {...}
- waitProxy.Value = not waitProxy.Value
- end)
- conn[#conn+1] = c
- end
- --
- waitProxy.Changed:wait()
- --
- return unpack(eventargs)
- end
- ----------------------------------------------
- -- Tool singleton class
- --API:
- -- ...
- class'Tool'(nil, function(this)
- --need this here for the animationprovider to use
- this.HUGE_EQUIP_HACK = false
- this.Bin = CreateBin()
- this.AnimationProvider = CreateAnimationProvider()
- this.DebounceProvider = CreateDebounceProvider()
- this.SoundProvider = CreateSoundProvider()
- --general values
- this.Tool = script.Parent
- this.Player = nil
- this.Humanoid = nil
- this.Character = nil
- --============ several flags for the gear
- --nothing
- --some events
- this.Equipped = CreateSignal()
- this.Unequipped = CreateSignal()
- this.OwnerChange = CreateSignal()
- --mouse utility events
- this.MouseClick = CreateSignal()
- this.MouseDoubleClick = CreateSignal()
- this.DoubleClickThreshold = 0.2
- local mLastClickTime = 0
- script.Parent.Equipped:connect(function(mouse)
- --print("Internal Equipped: Time b: "..time())
- --set up general values in the tool
- this.Mouse = mouse
- local curOwner = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
- if curOwner ~= this.Player then
- this.Player = curOwner
- this.OwnerChange:fire(this.Player)
- end
- this.Character = this.Player.Character
- this.Humanoid = this.Character.Humanoid
- this.AnimationProvider:setHumanoid(this.Humanoid)
- --set up the mouse events
- mouse.Button1Down:connect(function()
- local t = tick()
- if (t-mLastClickTime) < this.DoubleClickThreshold then
- --prvent multiple double-clicks in a row
- mLastClickTime = 0
- this.MouseDoubleClick:fire(mouse)
- else
- mLastClickTime = t
- this.MouseClick:fire(mouse)
- end
- end)
- --done setup, call the equipped function
- if this.HUGE_EQUIP_HACK then
- --the HUGE_EQUIP_HACK flags tells the tool that the equip is a synchronous
- --call as a result of parenting an animation to the character, which happens
- --when the tool is picked up from the workspace, but not during normal equips
- --(Why does this happen???), if this is the case, the call should be rederrred
- --one tick to ensure that all of the gear's loading can complete before it's
- --equipped event is called.
- --TODO: Blame John for this.
- Delay(0, function()
- this.Equipped:fire(mouse)
- end)
- else
- --otherwise, proceed as normal
- this.Equipped:fire(mouse)
- end
- end)
- script.Parent.Unequipped:connect(function()
- --before my teardown, fire the event
- this.Unequipped:fire()
- --delete all my garbage
- this.Bin:cleanAll()
- end)
- end)
- ---------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------
- -- --
- -- Specific Gear code starts Here --
- -- --
- ---------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------
- --register my stuff
- Tool.AnimationProvider:registerAnimation('equip', 'http://www.roblox.com/asset/?id=66702743')
- Tool.AnimationProvider:registerAnimation('slash', 'http://www.roblox.com/asset/?id=66702758')
- Tool.AnimationProvider:registerAnimation('critup', 'http://www.roblox.com/asset/?id=66703957')
- Tool.AnimationProvider:registerAnimation('critdown', 'http://www.roblox.com/asset/?id=66703954')
- Tool.SoundProvider:registerSound('slash', 'rbxasset://sounds\\swordslash.wav')
- Tool.SoundProvider:registerSound('equip', 'rbxasset://sounds\\unsheath.wav')
- Tool.SoundProvider:registerSound('down', 'rbxasset://sounds\\swordlunge.wav')
- Tool.SoundProvider:registerSound('hitground', 'rbxasset://sounds\\snap.wav')
- local DamageEnbled = false
- local DamageToDo = 20
- local SparkleParts = {}
- local SparkleAttach = {}
- Tool.Equipped:connect(function()
- print("Equipped")
- Tool.AnimationProvider:getAnimation('equip'):Play(0, 1, 3)
- Tool.SoundProvider:getSound('equip'):Play()
- local handleTouchedConn = Tool.Tool.Handle.Touched:connect(function(part)
- local h = (part.Parent or game):FindFirstChild("Humanoid")
- if DamageEnbled and h then
- TagHumanoid(h)
- h:TakeDamage(DamageToDo)
- wait(1)
- UntagHumanoid()
- end
- end)
- Tool.Bin:add(function()
- handleTouchedConn:disconnect()
- end, 'disconnect_handle_ontouched')
- local color = true
- for i = -3, 3, 1.5 do
- color = not color
- local p = Create'Part'{
- Name = 'EffectPart',
- FormFactor = 'Custom',
- Size = Vector3.new(0.1, 0.1, 0.1),
- Parent = Tool.Tool.Handle,
- Transparency = 1,
- CanCollide = false,
- Create'Fire'{
- Name = 'Effect',
- Enabled = false,
- Color = (color and Color3.new(1, 0, 0) or Color3.new(1, 1, 1)),
- Size = 2,
- },
- }
- --[[SparkleParts[#SparkleParts+1] = p
- local motor = Create'Motor6D'{
- Name = 'EffectAttach',
- Parent = Tool.Tool.Handle,
- Part0 = Tool.Tool.Handle,
- Part1 = p,
- C1 = CFrame.new(i, 0, 0),
- }
- SparkleAttach[#SparkleAttach+1] = motor]]
- end
- Tool.Bin:add(function()
- for _, effectPart in pairs(SparkleParts) do
- effectPart.Parent = nil
- end
- for _, p in pairs(SparkleAttach) do
- p.Parent = nil
- end
- SparkleParts = {}
- SparkleAttach = {}
- end, 'kill_particle_effect')
- end)
- Tool.Unequipped:connect(function()
- Tool.AnimationProvider:getAnimation('equip'):Stop()
- end)
- --utility to enable / disable damage. Makes sure that enable-disable
- --pairs don't ever interfear with one and other.
- local damageEnabledLevel = 0
- local function EnableDamage(damage)
- DamageEnbled = true
- DamageToDo = damage
- damageEnabledLevel = damageEnabledLevel + 1
- end
- local function DisableDamage()
- damageEnabledLevel = damageEnabledLevel - 1
- if damageEnabledLevel <= 0 then
- DamageEnbled = false
- end
- end
- --set particles enabled
- local function SetBladeEffectEnabled(state)
- for _, effectPart in pairs(SparkleParts) do
- effectPart.Effect.Enabled = state
- end
- end
- local function frand(low, high)
- return low + math.random()*(high-low)
- end
- --local blues = {23,107,102,11,45,135}
- local blues = {5, 24, 1009, 105, 1017}
- function allThatIce(pos, isTurbo)
- local count = 5
- if (isTurbo == true) then count = 10 end
- for i=1,count do
- local p = Instance.new("Part")
- p.BrickColor = BrickColor.new(blues[math.random(#blues)])
- p.formFactor = 2
- p.Size = Vector3.new(1,.4,1)
- p.Material = Enum.Material.Ice
- p.TopSurface = 0
- p.BottomSurface = 0
- local a = math.random() * 6.28
- local d = Vector3.new(math.cos(a), 0, math.sin(a)).unit
- p.Velocity = d * 25
- p.RotVelocity = d
- p.Position = pos + Vector3.new(0, math.random() * 3, 0) + (d * 2)
- p.Parent = game.Workspace
- debris:AddItem(p, 4)
- end
- end
- --make the hitting ground effect
- local PossibleSplashColors = {Color3.new(1, 0, 0), Color3.new(.5, 0, 0)}
- local function CreateSplashEffect(pos)
- local splashParts = {}
- for i = 1, 20 do
- local part = Create'Part'{
- FormFactor = 'Custom',
- Name = 'SlashParticle',
- Transparency = 1,
- CanCollide = false,
- Size = Vector3.new(0.5, 0.5, 0.5),
- CFrame = CFrame.new(pos),
- Create'Fire'{
- Name = 'Effect',
- Size = 2,
- Color = PossibleSplashColors[math.random(1, #PossibleSplashColors)],
- },
- Create'BodyVelocity'{
- Name = 'Fly',
- P = 100000,
- maxForce = Vector3.new(0, 0, 0),
- velocity = Vector3.new(frand(-1, 1),
- frand(0.5,1),
- frand(-1, 1)).unit * frand(20, 80),
- },
- }
- splashParts[#splashParts+1] = part
- part.Parent = game.Workspace
- part.Velocity = part.Fly.velocity
- Delay(frand(0.5, 2), function()
- part.Parent = nil
- end)
- end
- Tool.Bin:add(function()
- for _, p in pairs(splashParts) do
- p.Parent = nil
- end
- end, 'remove_splash_effect')
- end
- --====== main action code
- Tool.MouseClick:connect(function()
- if Tool.DebounceProvider:test('slash', 0.5) then
- Tool.DebounceProvider:set('slash')
- Tool.AnimationProvider:getAnimation('slash'):Play(0, 1, 4)
- Tool.SoundProvider:getSound('slash'):Play()
- EnableDamage(20)
- wait(0.7)
- DisableDamage()
- end
- end)
- Tool.MouseDoubleClick:connect(function()
- if not Tool.DebounceProvider:test('doubleclick') then
- Tool.DebounceProvider:set('doubleclick', true)
- --
- Tool.AnimationProvider:getAnimation('slash'):Stop(0)
- Tool.AnimationProvider:getAnimation('critup'):Play(0, 1, 8)
- local torso = Tool.Character:FindFirstChild("Torso")
- if torso then
- --jump high
- Tool.Humanoid.Jump = true
- torso.Velocity = torso.Velocity + Vector3.new(0, 120, 0)-- + (torso.CFrame.lookVector * 150)
- local bv = Instance.new("BodyAngularVelocity")
- bv.P = 1250
- local mmm = torso.CFrame.lookVector
- bv.angularvelocity = Vector3.new(mmm.z, 0, -mmm.x) * 8 --Vector3.new(0,0,0)
- bv.maxTorque = Vector3.new(400000,400000,400000)
- bv.Parent = torso
- --wait for the character to reach the top of their jump
- while torso.Velocity.y > 0.1 do
- wait()
- end
- bv:Remove()
- --[[
- local pos = torso.Position
- for i, v in pairs(Workspace:GetChildren()) do
- local h = v:FindFirstChild("Humanoid")
- if h and h ~= Tool.Character.Humanoid then
- local t = v:FindFirstChild("Torso")
- if t then
- if (t.Position - pos).magnitude <= 15 then
- h.Sit = true
- h.Parent.Torso.Velocity = (CFrame.new(script.Parent.Handle.Position, h.Parent.Torso.Position).lookVector * 200) + Vector3.new(0, 100, 0)
- h.Parent.Torso.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
- end
- end
- end
- end]]
- --now, switch to the critdown anim / sound, activate the damage,
- --and wait for the player to hit something on their way down.
- --also, speed up their descent
- EnableDamage(40)
- Tool.AnimationProvider:getAnimation('critup'):Stop(0)
- Tool.AnimationProvider:getAnimation('critdown'):Play(0, 1, 10)
- Tool.SoundProvider:getSound('down'):Play()
- torso.Velocity = torso.Velocity - Vector3.new(0, 10, 0)
- SetBladeEffectEnabled(true) --show some particles on the way down
- local rightLeg = Tool.Character:FindFirstChild('Right Leg')
- local leftLeg = Tool.Character:FindFirstChild('Left Leg')
- WaitForAny{rightLeg.Touched, leftLeg.Touched}
- SetBladeEffectEnabled(false) --get rid of the particles, we've leanded
- --play the hit gound sound
- Tool.SoundProvider:getSound('hitground'):Play()
- --generate a splash effect where the collision occurred
- local handle = Tool.Tool:FindFirstChild('Handle')
- if handle then
- --CreateSplashEffect((handle.CFrame*CFrame.new(2.5, 0, 0)).p)
- allThatIce((handle.CFrame*CFrame.new(2.5,0,0)).p, true)
- end
- --now, we touched down, so halt the player for a cooldown, and
- --wait a bit for the cooldown to expire
- Tool.Humanoid.WalkSpeed = 0
- wait(0.175)
- --unfreeze them and stop the anim, also, disable the damage
- Tool.Humanoid.WalkSpeed = 16
- Tool.AnimationProvider:getAnimation('critdown'):Stop()
- DisableDamage()
- else
- --no torso? Something is wrong, stop the anim
- Tool.AnimationProvider:getAnimation('critup'):Stop(0)
- end
- --
- Tool.DebounceProvider:set('doubleclick', false)
- end
- end)
- --print("Done Running swordscript <"..mDebugId..">")
- end))
- Script14.Name = "MotorizeRightGrip"
- Script14.Parent = LocalScript13
- table.insert(cors,sandbox(Script14,function()
- function Create(ty)
- return function(data)
- local obj = Instance.new(ty)
- for k, v in pairs(data) do
- if type(k) == 'number' then
- v.Parent = obj
- else
- obj[k] = v
- end
- end
- return obj
- end
- end
- local Tool = script.Parent.Parent
- local armChildRemovedConn = nil
- local Motor6DGrip = nil
- local EquippedNum = 0
- Tool.Equipped:connect(function()
- EquippedNum = EquippedNum + 1
- local myEquip = EquippedNum
- --some vars
- local Player = game.Players:GetPlayerFromCharacter(Tool.Parent)
- local Character = Player.Character
- local rightarm = Character:FindFirstChild('Right Arm')
- if rightarm and rightarm:FindFirstChild('RightGrip') then
- local rightGrip = rightarm['RightGrip']
- local handle = rightGrip.Part1
- --kill my joint when the normal joint is removed
- --this must be done here so that the joint is removed
- --_right away_ after unequipping and the character doesn't
- --glitch up.
- local armChildRemovedConn = rightarm.ChildRemoved:connect(function(ch)
- if ch == rightGrip then
- Motor6DGrip:Remove()
- Motor6DGrip = nil
- --
- if handle and Character:FindFirstChild('Torso') then
- if Tool.Parent.Parent:IsA('Player') then
- --the sword has been deselected
- --put the sword far away so the user doesn't notice that the handle doesn't
- --update for about 0.1 seconds after selecting the tool.
- handle.CFrame = CFrame.new(100000, 100000, 100000)
- else
- --if in the workspace, position the handle where it should be dropped
- --use the size of the handle to make sure it's dropped far enough away
- handle.CFrame = Character.Torso.CFrame * CFrame.new(0, 0, -(handle.Size.magnitude+2))
- end
- end
- end
- end)
- --make my new joint
- Motor6DGrip = Create'Motor6D'{
- Name = 'RightGrip_Motor',
- Part0 = rightarm,
- Part1 = handle,
- }
- --kill the old weld
- rightGrip.Part1 = nil
- rightGrip.Part0 = nil
- Motor6DGrip.Parent = rightGrip.Parent
- Motor6DGrip.C1 = Motor6DGrip.C1 * CFrame.Angles(0, -math.pi/2, 0)
- Motor6DGrip.C1 = Motor6DGrip.C1 * CFrame.Angles(math.pi/2, 0, 0)
- Motor6DGrip.C1 = Motor6DGrip.C1 + Vector3.new(0.20, 0, 0)
- end
- end)
- Tool.Unequipped:connect(function()
- EquippedNum = EquippedNum + 1
- if armChildRemovedConn then
- armChildRemovedConn:disconnect()
- armChildRemovedConn = nil
- end
- end)
- end))
- Animation15.Name = "ANIM_equip"
- Animation15.Parent = Tool0
- Animation15.AnimationId = "rbxassetid://4047725350"
- Animation16.Name = "ANIM_slash"
- Animation16.Parent = Tool0
- Animation16.AnimationId = "rbxassetid://4059144400"
- Animation17.Name = "ANIM_critup"
- Animation17.Parent = Tool0
- Animation17.AnimationId = "rbxassetid://4047725350"
- Animation18.Name = "ANIM_critdown"
- Animation18.Parent = Tool0
- Animation18.AnimationId = "rbxassetid://4047725350"
- LocalScript19.Name = "SpinScr"
- LocalScript19.Parent = Tool0
- table.insert(cors,sandbox(LocalScript19,function()
- on = 0
- Tool = script.Parent
- torso = nil
- human = nil
- bv = Instance.new("BodyAngularVelocity")
- bv.P = 1250
- bv.angularvelocity = Vector3.new(0,26,0)
- bv.maxTorque = Vector3.new(0,400000,0)
- function Crouch(ison)
- if torso == nil then
- torso = Tool.Parent:FindFirstChild("Torso")
- end
- if human == nil then
- human = Tool.Parent:FindFirstChild("Humanoid")
- end
- if ison == 0 then
- while torso:FindFirstChild("BodyAngularVelocity") do
- torso:FindFirstChild("BodyAngularVelocity"):Remove()
- end
- human.WalkSpeed = 16
- elseif ison == 1 then
- newf = bv:Clone()
- newf.Parent = torso
- newf.archivable = false
- human.WalkSpeed = 32
- end
- end
- function Key(key)
- if key then
- key = string.lower(key)
- if (key=="x") then --SPIN TIME!
- print("X key pressed")
- if on == 1 then
- on = 0
- elseif on == 0 then
- on = 1
- end
- Crouch(on)
- end
- end
- end
- function Equip(mouse)
- mouse.KeyDown:connect(Key)
- end
- function Unequip()
- print("Unequipping!")
- while torso:FindFirstChild("BodyAngularVelocity") do
- torso:FindFirstChild("BodyAngularVelocity"):Remove()
- end
- human.WalkSpeed = 16
- end
- script.Parent.Equipped:connect(Equip)
- script.Parent.Unequipped:connect(Unequip)
- end))
- Script20.Parent = Tool0
- table.insert(cors,sandbox(Script20,function()
- print ("VIP Shirt Door Script Loaded")
- -- list of account names allowed to go through the door.
- permission = { "robloxowns1" , "cooldog0204" , "http://www.roblox.com/Fight-On-A-Nintendo-3DS-VIP-item?id=94383317" } -- This is how many people can still get through, so u don't have to change shirts. You can also have another friend here.
- -- TextureId of the VIP shirt.
- texture = "http://www.roblox.com/Fight-On-A-Nintendo-3DS-VIP-item?id=94383317" -- Go to the wiki below this script to find out how to change the shirt. And paste the link in between the "" marks.
- function checkOkToLetIn(name)
- for i = 1,#permission do
- -- convert strings to all upper case, otherwise we will let in
- -- "Username" but not "username" or "uSERNAME"
- if (string.upper(name) == string.upper(permission[i])) then return true end
- end
- return false
- end
- local Door = script.Parent
- function onTouched(hit)
- print("Door Hit")
- local human = hit.Parent:findFirstChild("Humanoid")
- if (human ~= nil ) then
- if human.Parent.Torso.roblox.Texture == texture then --the shirt
- Door.Transparency = 0.7
- Door.CanCollide = false
- wait(4) -- this is how long the door is open
- Door.CanCollide = true
- Door.Transparency = 0
- -- a human has touched this door!
- print("Human touched door")
- -- test the human's name against the permission list
- elseif (checkOkToLetIn(human.Parent.Name)) then
- print("Human passed test")
- Door.Transparency = 0.7
- Door.CanCollide = false
- wait(4) -- this is how long the door is open
- Door.CanCollide = true
- Door.Transparency = 0
- else human.Health = 0 -- delete this line of you want a non-killing VIP door
- end
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement