Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The dagger --
- -- code writen by oof0m animations animated by oof0m --
- -- inspired by the catalog item "dagger of shattered dimensions" --
- -- enjoy! --
- -- This script has been converted to FE by timlikekezenit
- 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
- print("FE Compatibility by timlikekezenit")
- 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
- local plr = owner
- local char = plr.Character
- warn ("-- The Dagger --")
- warn("TIME STOPS NOW!")
- warn("The Dagger script writen by oof0m")
- if char:FindFirstChild("LowerTorso") then
- warn("Cannot load. Character has an R15 avatar.")
- warn("----------------")
- else
- warn("Successfully loaded. Character has an R6 avatar.")
- warn("----------------")
- local mouse = plr:GetMouse()
- char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://4519715462"
- char.Animate.idle.Animation1.AnimationId = "rbxassetid://4518288762"
- char.Animate.idle.Animation2.AnimationId = "rbxassetid://4518300834"
- char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://4519812406"
- char.Animate.fall.FallAnim.AnimationId = "rbxassetid://4519814413"
- local handle = Instance.new("Part",char)
- local mesh = Instance.new("SpecialMesh",char)
- handle.CanCollide = false
- handle.Position = char["Right Arm"].Position + Vector3.new(2,0,0)
- mesh.MeshId = "rbxassetid://70990583"
- mesh.TextureId = "rbxassetid://70990591"
- --handle.Parent=char
- local weld = Instance.new("Weld",char)
- weld.Name = "daggerWeld"
- weld.Part0 = char["Right Arm"]
- weld.Part1 = handle
- local input = game:GetService("UserInputService")
- local event = Instance.new("RemoteEvent",game.ReplicatedStorage)
- event.Name = "workEvent"
- event:FireClient(plr)
- local function hi()
- local scripta = Instance.new("LocalScript",event)
- scripta.Parent.OnClientEvent:Connect(function()
- mouse.KeyDown:Connect(function(key)
- if key == Enum.KeyCode.Q then
- scripta.Parent:FireServer()
- end
- end)
- end)
- end
- coroutine.wrap(hi)
- local function bye()
- local scriptb = Instance.new("Script",event)
- scriptb.Parent.OnServerEvent:Connect(function()
- print("Stopping time...")
- local oldspeed = char.Humanoid.WalkSpeed
- local oldjp = char.Humanoid.JumpPower
- wait()
- char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://4519721290"
- char.Animate.idle.Animation1.AnimationId = "rbxassetid://4519721290"
- char.Animate.idle.Animation2.AnimationId = "rbxassetid://4519721290"
- char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://4519721290"
- char.Animate.fall.FallAnim.AnimationId = "rbxassetid://4519721290"
- char.Humanoid.WalkSpeed = 0
- char.Humanoid.JumpPower = 0
- local timewave = Instance.new("Part",workspace)
- local timewavedecal = Instance.new("Decal",timewave)
- timewavedecal.Texture = "rbxassetid://70991028"
- timewavedecal.Face = "Left"
- timewave.Shape = Enum.PartType.Cylinder
- timewave.Orientation = Vector3.new(0,90,0)
- timewave.Size = Vector3.new(.0001,1,0)
- timewave.Anchored = true
- while wait() do
- timewave.Position = char.Position - Vector3.new(0,2,0)
- end
- local tws = game.TweenService
- local t = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
- local propertyTween = {Size = Vector3.new(.0001,50,0)}
- tws:Create(timewave,t,propertyTween)
- wait(1)
- local stopped = Instance.new("Part",workspace)
- stopped.Color = Color3.new(255,170,0)
- stopped.CanCollide = false
- stopped.Position = timewave.Position
- stopped.Anchored = true
- stopped.Size = Vector3.new(50,50,50)
- stopped.Material = Enum.Material.ForceField
- stopped.Touched:Connect(function(user)
- if not user.Parent.Name == plr.Name then
- user.Parent.HumanoidRootPart.Anchored = true
- char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://4519715462"
- char.Animate.idle.Animation1.AnimationId = "rbxassetid://4518288762"
- char.Animate.idle.Animation2.AnimationId = "rbxassetid://4518300834"
- char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://4519812406"
- char.Animate.fall.FallAnim.AnimationId = "rbxassetid://4519814413"
- char.Humanoid.WalkSpeed = oldspeed
- char.Humanoid.JumpPower = oldjp
- wait(10)
- local propertyTween2 = {Size = Vector3.new(0,0,0)}
- tws:Create(stopped,t,propertyTween2)
- user.Parent.HumanoidRootPart.Anchored = false
- stopped:Destroy()
- end
- end)
- wait()
- local bubbleclose = stopped:Clone()
- bubbleclose.Color = Color3.new(0,0,0)
- local propertyTween = {Size = Vector3.new(0,0,0)}
- tws:Create(bubbleclose,t,propertyTween)
- wait(1)
- bubbleclose:Destroy()
- timewave:Destroy()
- end)
- end
- coroutine.wrap(bye)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement