Advertisement
pitrioptixiop

My own version of the scanner script in roblox

Mar 11th, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.57 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. lp = game.Players.LocalPlayer
  8. char = lp.Character
  9. head = char.Head
  10. hum = char.Humanoid
  11. bp = lp.Backpack
  12. gui = lp.PlayerGui
  13. scanmsg = nil
  14. toweractive = false
  15. equip = false
  16. scanner = Instance.new("Tool",bp)
  17. scanner.Name = "Scanner"
  18. shandle = Instance.new("Part",scanner)
  19. shandle.Size = Vector3.new(3,2,1)
  20. shandle.Name = "Handle"
  21. scanner.Equipped:connect(function()
  22.     if toweractive == false then
  23.         scanmsg = Instance.new("Message",gui)
  24.         scanmsg.Text = "NO SIGNAL"
  25.     end
  26.     if toweractive == true then
  27.         scanmsg = Instance.new("Message",gui)
  28.         scanmsg.Text = "NO DATA"
  29.         equip = true
  30.     end
  31. end)
  32. scanner.Unequipped:connect(function()
  33.     if scanmsg ~= nil then
  34.         scanmsg:Destroy()
  35.         equip = false
  36.     end
  37. end)
  38. scanner.Activated:connect(function()
  39.     if equip then
  40.         mouse = lp:GetMouse()
  41.         target = mouse.Target
  42.             if target then
  43.                 if target.Parent then
  44.                     if target.Name == "Head" and target.Parent:FindFirstChildOfClass("Humanoid") then
  45.                         parent = target.Parent
  46.                         victimhum = parent.Humanoid
  47.                         player = game:GetService("Players"):GetPlayerFromCharacter(parent)
  48.                             if player == nil then
  49.                                 if scanmsg ~= nil then
  50.                                     scanmsg.Text = "[ISN'T A PLAYER]\nName-"..parent.Name.."\nWalkSpeed-"..tostring(victimhum.WalkSpeed).."[DEFAULT:16]\nJumpPower-"..tostring(victimhum.JumpPower).."[DEFAULT:50]\nSitting-"..tostring(victimhum.Sit).."\nPlatformStanding-"..tostring(victimhum.PlatformStand)
  51.                                 end
  52.                             end
  53.                             if player ~= nil then
  54.                                 if scanmsg ~= nil then
  55.                                     scanmsg.Text = "Name-"..parent.Name.."\nWalkSpeed-"..tostring(victimhum.WalkSpeed).."[DEFAULT:16]\nJumpPower-"..tostring(victimhum.JumpPower).."[DEFAULT:50]\nSitting-"..tostring(victimhum.Sit).."\nPlatformStanding-"..tostring(victimhum.PlatformStand).."\nUserId-"..tostring(player.UserId).."\nAccountAge-"..tostring(player.AccountAge).."\nCharacterAppearanceId-"..tostring(player.CharacterAppearanceId)
  56.                                 end
  57.                             end
  58.                         end
  59.                     end
  60.                 end
  61.         end
  62.     end)
  63. build = Instance.new("Tool",bp)
  64. build.Name = "Build antenna"
  65. bhandle = Instance.new("Part",build)
  66. bhandle.Size = Vector3.new(3,2,1)
  67. bhandle.Name = "Handle"
  68. build.Equipped:connect(function()
  69.     wait(0.1)
  70.     build:Destroy()
  71.     hum.Sit = true
  72.     wait(2)
  73.     cframe = head.CFrame + Vector3.new(10,0,0)
  74.     part = Instance.new("Part",workspace)
  75.     part.Size = Vector3.new(5,1,5)
  76.     part.CFrame = cframe
  77.     wait(1)
  78.     part.Anchored = true
  79.     wait(1)
  80.     part2 = Instance.new("Part",workspace)
  81.     part2.Size = Vector3.new(1,5,1)
  82.     part2.Position = part.Position
  83.     part2.Anchored = true
  84.     part2.BrickColor = BrickColor.Red()
  85.     part2.Material = Enum.Material.Neon
  86.     click = Instance.new("ClickDetector",part2)
  87.     click.MaxActivationDistance = 15
  88.     click.MouseClick:connect(function()
  89.         if toweractive then
  90.             toweractive = false
  91.             part2.BrickColor = BrickColor.Red()
  92.         else
  93.             toweractive = true
  94.             part2.BrickColor = BrickColor.Green()
  95.         end
  96.     end)
  97.     wait(2)
  98.     part3 = Instance.new("Part",workspace)
  99.     part3.Anchored = true
  100.     part3.Size = Vector3.new(5,3,5)
  101.     part3.Position = part2.Position
  102.     wait(2)
  103.     part4 = Instance.new("Part",workspace)
  104.     part4.Anchored = true
  105.     part4.Size = Vector3.new(3,3,3)
  106.     part4.Position = part3.Position
  107.     wait(2)
  108.     part5 = Instance.new("Part",workspace)
  109.     part5.Anchored = true
  110. part5.Size = Vector3.new(2,2,2)
  111. part5.Position = part4.Position
  112. wait(2)
  113. part6 = Instance.new("Part",workspace)
  114. part6.Anchored = true
  115. part6.Size = Vector3.new(1,1,1)
  116. part6.Position = part5.Position
  117. wait(2)
  118. part7 = Instance.new("Part",workspace)
  119. part7.Anchored = true
  120. part7.Size = Vector3.new(5,5,5)
  121. part7.Position = part6.Position
  122. decalfront = Instance.new("Decal",part7)
  123. decalfront.Texture = "http://www.roblox.com/asset/?id=164773235"
  124. decalfront.Face = Enum.NormalId.Front
  125. decalback = Instance.new("Decal",part7)
  126. decalback.Texture = "http://www.roblox.com/asset/?id=164773235"
  127. decalback.Face = Enum.NormalId.Back
  128. decalleft = Instance.new("Decal",part7)
  129. decalleft.Texture = "http://www.roblox.com/asset/?id=164773235"
  130. decalleft.Face = Enum.NormalId.Left
  131. decalright = Instance.new("Decal",part7)
  132. decalright.Texture = "http://www.roblox.com/asset/?id=164773235"
  133. decalright.Face = Enum.NormalId.Right
  134. decaltop = Instance.new("Decal",part7)
  135. decaltop.Texture = "http://www.roblox.com/asset/?id=164773235"
  136. decaltop.Face = Enum.NormalId.Top
  137. decalbottom = Instance.new("Decal",part7)
  138. decalbottom.Texture = "http://www.roblox.com/asset/?id=164773235"
  139. decalbottom.Face = Enum.NormalId.Bottom
  140. wait(1)
  141. hum.Jump = true
  142. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement