Advertisement
thatonepuggo

The Dagger [ROBLOX FE]

Dec 17th, 2019
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.29 KB | None | 0 0
  1.  
  2. -- The dagger                                                    --
  3. -- code writen by oof0m animations animated by oof0m             --
  4. -- inspired by the catalog item "dagger of shattered dimensions" --
  5. -- enjoy!                                                        --
  6. -- This script has been converted to FE by timlikekezenit
  7.  
  8.  
  9. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  10. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  11. do
  12.     print("FE Compatibility by timlikekezenit")
  13.     script.Parent = Player.Character
  14.  
  15.     --RemoteEvent for communicating
  16.     local Event = Instance.new("RemoteEvent")
  17.     Event.Name = "UserInput_Event"
  18.  
  19.     --Fake event to make stuff like Mouse.KeyDown work
  20.     local function fakeEvent()
  21.         local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  22.         t.connect = t.Connect
  23.         return t
  24.     end
  25.  
  26.     --Creating fake input objects with fake variables
  27.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  28.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  29.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  30.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  31.     end}
  32.     --Merged 2 functions into one by checking amount of arguments
  33.     CAS.UnbindAction = CAS.BindAction
  34.  
  35.     --This function will trigger the events that have been :Connect()'ed
  36.     local function te(self,ev,...)
  37.         local t = m[ev]
  38.         if t and t._fakeEvent and t.Function then
  39.             t.Function(...)
  40.         end
  41.     end
  42.     m.TrigEvent = te
  43.     UIS.TrigEvent = te
  44.  
  45.     Event.OnServerEvent:Connect(function(plr,io)
  46.         if plr~=Player then return end
  47.         if io.isMouse then
  48.             m.Target = io.Target
  49.             m.Hit = io.Hit
  50.         else
  51.             local b = io.UserInputState == Enum.UserInputState.Begin
  52.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  53.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  54.             end
  55.             for _,t in pairs(CAS.Actions) do
  56.                 for _,k in pairs(t.Keys) do
  57.                     if k==io.KeyCode then
  58.                         t.Function(t.Name,io.UserInputState,io)
  59.                     end
  60.                 end
  61.             end
  62.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  63.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  64.         end
  65.     end)
  66.     Event.Parent = NLS([==[
  67.     local Player = game:GetService("Players").LocalPlayer
  68.     local Event = script:WaitForChild("UserInput_Event")
  69.  
  70.     local UIS = game:GetService("UserInputService")
  71.     local input = function(io,a)
  72.         if a then return end
  73.         --Since InputObject is a client-side instance, we create and pass table instead
  74.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  75.     end
  76.     UIS.InputBegan:Connect(input)
  77.     UIS.InputEnded:Connect(input)
  78.  
  79.     local Mouse = Player:GetMouse()
  80.     local h,t
  81.     --Give the server mouse data 30 times every second, but only if the values changed
  82.     --If player is not moving their mouse, client won't fire events
  83.     while wait(1/30) do
  84.         if h~=Mouse.Hit or t~=Mouse.Target then
  85.             h,t=Mouse.Hit,Mouse.Target
  86.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  87.         end
  88.     end]==],Player.Character)
  89.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  90. end
  91.  
  92.  
  93. local plr = owner
  94. local char = plr.Character
  95. warn ("-- The Dagger --")
  96. warn("TIME STOPS NOW!")
  97. warn("The Dagger script writen by oof0m")
  98. if char:FindFirstChild("LowerTorso") then
  99. warn("Cannot load. Character has an R15 avatar.")
  100. warn("----------------")
  101. else
  102. warn("Successfully loaded. Character has an R6 avatar.")
  103. warn("----------------")
  104. local mouse = plr:GetMouse()
  105. char.Animate.walk.WalkAnim.AnimationId  = "rbxassetid://4519715462"
  106. char.Animate.idle.Animation1.AnimationId = "rbxassetid://4518288762"
  107. char.Animate.idle.Animation2.AnimationId = "rbxassetid://4518300834"
  108. char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://4519812406"
  109. char.Animate.fall.FallAnim.AnimationId = "rbxassetid://4519814413"
  110. local handle = Instance.new("Part",char)
  111. local mesh = Instance.new("SpecialMesh",char)
  112.  
  113. handle.CanCollide = false
  114. handle.Position = char["Right Arm"].Position + Vector3.new(2,0,0)
  115. mesh.MeshId = "rbxassetid://70990583"
  116. mesh.TextureId = "rbxassetid://70990591"
  117. --handle.Parent=char
  118. local weld = Instance.new("Weld",char)
  119. weld.Name = "daggerWeld"
  120. weld.Part0 = char["Right Arm"]
  121. weld.Part1 = handle
  122.  
  123.  
  124.     local input = game:GetService("UserInputService")
  125.     local event = Instance.new("RemoteEvent",game.ReplicatedStorage)
  126.     event.Name = "workEvent"
  127.     event:FireClient(plr)
  128.     local function hi()
  129.         local scripta = Instance.new("LocalScript",event)
  130.         scripta.Parent.OnClientEvent:Connect(function()
  131.     mouse.KeyDown:Connect(function(key)
  132.    
  133.  
  134.     if key == Enum.KeyCode.Q then
  135. scripta.Parent:FireServer()
  136.     end
  137. end)
  138.         end)
  139.        
  140.  
  141.     end
  142.     coroutine.wrap(hi)
  143.     local function bye()
  144.         local scriptb = Instance.new("Script",event)
  145.         scriptb.Parent.OnServerEvent:Connect(function()
  146.                     print("Stopping time...")
  147. local oldspeed = char.Humanoid.WalkSpeed
  148. local oldjp = char.Humanoid.JumpPower
  149. wait()
  150. char.Animate.walk.WalkAnim.AnimationId  = "rbxassetid://4519721290"
  151. char.Animate.idle.Animation1.AnimationId = "rbxassetid://4519721290"
  152. char.Animate.idle.Animation2.AnimationId = "rbxassetid://4519721290"
  153. char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://4519721290"
  154. char.Animate.fall.FallAnim.AnimationId = "rbxassetid://4519721290"
  155. char.Humanoid.WalkSpeed = 0
  156. char.Humanoid.JumpPower = 0
  157. local timewave = Instance.new("Part",workspace)
  158. local timewavedecal = Instance.new("Decal",timewave)
  159. timewavedecal.Texture = "rbxassetid://70991028"
  160. timewavedecal.Face = "Left"
  161. timewave.Shape = Enum.PartType.Cylinder
  162. timewave.Orientation = Vector3.new(0,90,0)
  163. timewave.Size = Vector3.new(.0001,1,0)
  164. timewave.Anchored = true
  165. while wait() do
  166. timewave.Position = char.Position - Vector3.new(0,2,0)
  167. end
  168. local tws = game.TweenService
  169. local t = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
  170. local propertyTween = {Size = Vector3.new(.0001,50,0)}
  171. tws:Create(timewave,t,propertyTween)
  172. wait(1)
  173. local stopped = Instance.new("Part",workspace)
  174. stopped.Color = Color3.new(255,170,0)
  175. stopped.CanCollide = false
  176. stopped.Position = timewave.Position
  177. stopped.Anchored = true
  178. stopped.Size = Vector3.new(50,50,50)
  179. stopped.Material = Enum.Material.ForceField
  180. stopped.Touched:Connect(function(user)
  181.     if not user.Parent.Name == plr.Name then
  182.         user.Parent.HumanoidRootPart.Anchored = true
  183.         char.Animate.walk.WalkAnim.AnimationId  = "rbxassetid://4519715462"
  184. char.Animate.idle.Animation1.AnimationId = "rbxassetid://4518288762"
  185. char.Animate.idle.Animation2.AnimationId = "rbxassetid://4518300834"
  186. char.Animate.jump.JumpAnim.AnimationId = "rbxassetid://4519812406"
  187. char.Animate.fall.FallAnim.AnimationId = "rbxassetid://4519814413"
  188. char.Humanoid.WalkSpeed = oldspeed
  189. char.Humanoid.JumpPower = oldjp
  190.         wait(10)
  191.         local propertyTween2 = {Size = Vector3.new(0,0,0)}
  192.         tws:Create(stopped,t,propertyTween2)
  193.         user.Parent.HumanoidRootPart.Anchored = false
  194.         stopped:Destroy()
  195.     end
  196. end)
  197.  
  198. wait()
  199. local bubbleclose = stopped:Clone()
  200. bubbleclose.Color = Color3.new(0,0,0)
  201. local propertyTween = {Size = Vector3.new(0,0,0)}
  202. tws:Create(bubbleclose,t,propertyTween)
  203. wait(1)
  204. bubbleclose:Destroy()
  205. timewave:Destroy()
  206.         end)
  207.     end
  208.     coroutine.wrap(bye)
  209. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement