Advertisement
subaru112g

remote control by me not ended

Feb 2nd, 2019
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  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. do
  5. print("FE Compatibility code by Mokiros")
  6. script.Parent = Player.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent and t.Function then
  32. t.Function(...)
  33. end
  34. end
  35. m.TrigEvent = te
  36. UIS.TrigEvent = te
  37.  
  38. Event.OnServerEvent:Connect(function(plr,io)
  39. if plr~=Player then return end
  40. if io.isMouse then
  41. m.Target = io.Target
  42. m.Hit = io.Hit
  43. else
  44. local b = io.UserInputState == Enum.UserInputState.Begin
  45. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  46. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  47. end
  48. for _,t in pairs(CAS.Actions) do
  49. for _,k in pairs(t.Keys) do
  50. if k==io.KeyCode then
  51. t.Function(t.Name,io.UserInputState,io)
  52. end
  53. end
  54. end
  55. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  56. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  57. end
  58. end)
  59. Event.Parent = NLS([==[
  60. local Player = game:GetService("Players").LocalPlayer
  61. local Event = script:WaitForChild("UserInput_Event")
  62.  
  63. local UIS = game:GetService("UserInputService")
  64. local input = function(io,a)
  65. if a then return end
  66. --Since InputObject is a client-side instance, we create and pass table instead
  67. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  68. end
  69. UIS.InputBegan:Connect(input)
  70. UIS.InputEnded:Connect(input)
  71.  
  72. local Mouse = Player:GetMouse()
  73. local h,t
  74. --Give the server mouse data 30 times every second, but only if the values changed
  75. --If player is not moving their mouse, client won't fire events
  76. while wait(1/30) do
  77. if h~=Mouse.Hit or t~=Mouse.Target then
  78. h,t=Mouse.Hit,Mouse.Target
  79. Event:FireServer({isMouse=true,Target=t,Hit=h})
  80. end
  81. end]==],Player.Character)
  82. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  83. end
  84. -------------------------------------------------------------------------------------------------------------------
  85.  
  86. print("Script made by Subaru112")
  87. warn("Remote control")
  88. print("Controls:")
  89. warn("Press Z to control person who your mouse is at.")
  90. warn("Press X to leave controled person's body.")
  91. warn("You can become invisible but if it happens then press X.")
  92.  
  93. local t = Instance.new("Tool",workspace)
  94. t.Name = "Remote"
  95. local h = Instance.new("Part",t)
  96. h.Name = "Handle"
  97. h.BrickColor = BrickColor.new("Really black")
  98. h.Size = Vector3.new(0.8, 0.2, 0.2)
  99. h.CFrame = CFrame.new(-59.473, 9.578, -5.851)
  100. h.Orientation = Vector3.new(0, 90, 0)
  101.  
  102. local o1 = Instance.new("Part",t)
  103. o1.Size = Vector3.new(0.8, 0.2, 1.5)
  104. o1.CFrame = CFrame.new(-60.173, 9.578, -5.851)
  105. o1.BrickColor = BrickColor.new("Really black")
  106. o1.Shape = "Block"
  107. o1.Orientation = Vector3.new(0, -90, 0)
  108. local m = Instance.new("BlockMesh",o1)
  109.  
  110. local o2 = Instance.new("Part",t)
  111. o2.Size = Vector3.new(0.4, 0.2, 0.5)
  112. o2.CFrame = CFrame.new(-60.373, 9.678, -5.851)
  113. o2.BrickColor = BrickColor.new("Really red")
  114. o2.Shape = "Block"
  115. o2.Orientation = Vector3.new(0, -90, 0)
  116. local m1 = Instance.new("BlockMesh",o2)
  117.  
  118. local o3 = Instance.new("Part",t)
  119. o3.Size = Vector3.new(0.1, 0.2, 0.2)
  120. o3.CFrame = CFrame.new(-62.073, 9.528, -5.828)
  121. o3.BrickColor = BrickColor.new("Really red")
  122. o3.Shape = "Cylinder"
  123. o3.Orientation = Vector3.new(0, 0, 0)
  124. o3.CanCollide = false
  125.  
  126. local o4 = Instance.new("Part",t)
  127. o4.Size = Vector3.new(1.1, 0.1, 0.1)
  128. o4.CFrame = CFrame.new(-61.473, 9.528, -5.828)
  129. o4.BrickColor = BrickColor.new("Really black")
  130. o4.Shape = "Cylinder"
  131. o4.Orientation = Vector3.new(0, 0, 0)
  132. o4.CanCollide = false
  133.  
  134. local prev
  135. local parts = t:GetChildren()
  136.  
  137. for i = 1,#parts do
  138. if (parts[i].className == "Part") then
  139. if (prev ~= nil)then
  140. local weld = Instance.new("Weld")
  141. weld.Part0 = prev
  142. weld.Part1 = parts[i]
  143. weld.C0 = prev.CFrame:inverse()
  144. weld.C1 = parts[i].CFrame:inverse()
  145. weld.Parent = prev
  146. end
  147. prev = parts[i]
  148. end
  149. end
  150.  
  151. t.Parent = owner.Backpack
  152.  
  153.  
  154. --This script is made by Subaru112.
  155.  
  156. local plr = owner
  157. local char = plr.Character
  158. local hum = char:FindFirstChildOfClass("Humanoid")
  159. local RS = char.Torso["Right Shoulder"]
  160. local LS = char.Torso["Left Shoulder"]
  161. local RH = char.Torso["Right Hip"]
  162. local LH = char.Torso["Left Hip"]
  163. local rootj = char.HumanoidRootPart.RootJoint
  164. local throwbutton = false
  165. local throw = false
  166. local normalanim = true
  167. local attackd = false
  168. local animpose = "Idle"
  169. local timepos = 0
  170. local sine = 0
  171. local RSnor = RS.C0
  172. local LSnor = LS.C0
  173. local RHnor = RH.C0
  174. local LHnor = LH.C0
  175. local rootjnor = rootj.C0
  176.  
  177. ---------------------------------
  178. --------------Set up-------------
  179. ---------------------------------
  180.  
  181. local char = owner.Character
  182.  
  183. local remotec = false
  184. local control = false
  185.  
  186. function control2(charact)
  187. local hum = charact:FindFirstChild("Humanoid")
  188. if hum then
  189. control = true
  190. local hed = hum.Parent.Head
  191. hum.PlatformStand = true
  192. local w = Instance.new("Weld")
  193. w.Part0 = char.Head
  194. w.Part1 = hed
  195. w.Name = "break"
  196. w.Parent = char
  197.  
  198. for i,v in pairs(hum.Parent:GetChildren()) do
  199. if v.Name == "Torso" or v.Name == "UpperTorso" then
  200. local w2 = Instance.new("Weld")
  201. w2.Part0 = char.Torso
  202. w2.Part1 = v
  203. w2.Name = "break"
  204. w2.Parent = char
  205. end
  206. end
  207.  
  208. for i,v in pairs(hum.Parent:GetChildren()) do
  209. if v.Name == "Right Arm" then
  210. local w3 = Instance.new("Weld")
  211. w3.Part0 = char["Right Arm"]
  212. w3.Part1 = v
  213. w3.Name = "break"
  214. w3.Parent = char
  215. end
  216. end
  217.  
  218. for i,v in pairs(hum.Parent:GetChildren()) do
  219. if v.Name == "Left Arm" then
  220. local w4 = Instance.new("Weld")
  221. w4.Part0 = char["Left Arm"]
  222. w4.Part1 = v
  223. w4.Name = "break"
  224. w4.Parent = char
  225. end
  226. end
  227.  
  228. for i,v in pairs(hum.Parent:GetChildren()) do
  229. if v.Name == "Right Leg" then
  230. local w5 = Instance.new("Weld")
  231. w5.Part0 = char["Right Leg"]
  232. w5.Part1 = v
  233. w5.Name = "break"
  234. w5.Parent = char
  235. end
  236. end
  237.  
  238. for i,v in pairs(hum.Parent:GetChildren()) do
  239. if v.Name == "Left Leg" then
  240. local w6 = Instance.new("Weld")
  241. w6.Part0 = char["Left Leg"]
  242. w6.Part1 = v
  243. w6.Name = "break"
  244. w6.Parent = char
  245. end
  246. end
  247.  
  248. hum.PlatformStand = true
  249. hum.PlatformStand = true
  250. hum.PlatformStand = true
  251. hum.PlatformStand = true
  252. hum.PlatformStand = true
  253. hum.PlatformStand = true
  254.  
  255. char.Head.face.Transparency = 1
  256. for i,v in pairs(char:GetChildren()) do
  257. if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  258. v.Handle.Transparency = 1
  259. end
  260. if v.ClassName == "Part" then
  261. v.Transparency = 1
  262. end
  263.  
  264. end
  265. end
  266. end
  267.  
  268. ---------------------------------
  269. -------------Attacks-------------
  270. ---------------------------------
  271.  
  272. Mouse.KeyDown:connect(function(k)
  273. k = k:lower()
  274. if k=='z' then
  275. if remotec == false and control == false and Mouse.Target.Parent ~= char and Mouse.Target.Parent.Parent ~= char and Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  276. control2(Mouse.Target.Parent)
  277. end
  278. elseif k=='x' then
  279. if control == true then
  280. control = false
  281. char.Head.face.Transparency = 0
  282. for i,v in pairs(char:GetChildren()) do
  283. if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  284. v.Handle.Transparency = 0
  285. end
  286. if v.ClassName == "Part" then
  287. if not(v.Name == "HumanoidRootPart") then
  288. v.Transparency = 0
  289. end
  290. end
  291. if v.Name == "break" then
  292. if v.ClassName == "Weld" then
  293. if v.Part1 ~= nil then
  294. local hum = v.Part1.Parent:FindFirstChildOfClass("Humanoid")
  295. if hum then
  296. hum.PlatformStand = false
  297. v:Destroy()
  298. end
  299. end
  300. end
  301. end
  302. end
  303. end
  304. end
  305. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement