Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- 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 code by Mokiros")
- 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
- -------------------------------------------------------------------------------------------------------------------
- print("Script made by Subaru112")
- warn("Remote control")
- print("Controls:")
- warn("Press Z to control person who your mouse is at.")
- warn("Press X to leave controled person's body.")
- warn("You can become invisible but if it happens then press X.")
- local t = Instance.new("Tool",workspace)
- t.Name = "Remote"
- local h = Instance.new("Part",t)
- h.Name = "Handle"
- h.BrickColor = BrickColor.new("Really black")
- h.Size = Vector3.new(0.8, 0.2, 0.2)
- h.CFrame = CFrame.new(-59.473, 9.578, -5.851)
- h.Orientation = Vector3.new(0, 90, 0)
- local o1 = Instance.new("Part",t)
- o1.Size = Vector3.new(0.8, 0.2, 1.5)
- o1.CFrame = CFrame.new(-60.173, 9.578, -5.851)
- o1.BrickColor = BrickColor.new("Really black")
- o1.Shape = "Block"
- o1.Orientation = Vector3.new(0, -90, 0)
- local m = Instance.new("BlockMesh",o1)
- local o2 = Instance.new("Part",t)
- o2.Size = Vector3.new(0.4, 0.2, 0.5)
- o2.CFrame = CFrame.new(-60.373, 9.678, -5.851)
- o2.BrickColor = BrickColor.new("Really red")
- o2.Shape = "Block"
- o2.Orientation = Vector3.new(0, -90, 0)
- local m1 = Instance.new("BlockMesh",o2)
- local o3 = Instance.new("Part",t)
- o3.Size = Vector3.new(0.1, 0.2, 0.2)
- o3.CFrame = CFrame.new(-62.073, 9.528, -5.828)
- o3.BrickColor = BrickColor.new("Really red")
- o3.Shape = "Cylinder"
- o3.Orientation = Vector3.new(0, 0, 0)
- o3.CanCollide = false
- local o4 = Instance.new("Part",t)
- o4.Size = Vector3.new(1.1, 0.1, 0.1)
- o4.CFrame = CFrame.new(-61.473, 9.528, -5.828)
- o4.BrickColor = BrickColor.new("Really black")
- o4.Shape = "Cylinder"
- o4.Orientation = Vector3.new(0, 0, 0)
- o4.CanCollide = false
- local prev
- local parts = t:GetChildren()
- for i = 1,#parts do
- if (parts[i].className == "Part") then
- if (prev ~= nil)then
- local weld = Instance.new("Weld")
- weld.Part0 = prev
- weld.Part1 = parts[i]
- weld.C0 = prev.CFrame:inverse()
- weld.C1 = parts[i].CFrame:inverse()
- weld.Parent = prev
- end
- prev = parts[i]
- end
- end
- t.Parent = owner.Backpack
- --This script is made by Subaru112.
- local plr = owner
- local char = plr.Character
- local hum = char:FindFirstChildOfClass("Humanoid")
- local RS = char.Torso["Right Shoulder"]
- local LS = char.Torso["Left Shoulder"]
- local RH = char.Torso["Right Hip"]
- local LH = char.Torso["Left Hip"]
- local rootj = char.HumanoidRootPart.RootJoint
- local throwbutton = false
- local throw = false
- local normalanim = true
- local attackd = false
- local animpose = "Idle"
- local timepos = 0
- local sine = 0
- local RSnor = RS.C0
- local LSnor = LS.C0
- local RHnor = RH.C0
- local LHnor = LH.C0
- local rootjnor = rootj.C0
- ---------------------------------
- --------------Set up-------------
- ---------------------------------
- local char = owner.Character
- local remotec = false
- local control = false
- function control2(charact)
- local hum = charact:FindFirstChild("Humanoid")
- if hum then
- control = true
- local hed = hum.Parent.Head
- hum.PlatformStand = true
- local w = Instance.new("Weld")
- w.Part0 = char.Head
- w.Part1 = hed
- w.Name = "break"
- w.Parent = char
- for i,v in pairs(hum.Parent:GetChildren()) do
- if v.Name == "Torso" or v.Name == "UpperTorso" then
- local w2 = Instance.new("Weld")
- w2.Part0 = char.Torso
- w2.Part1 = v
- w2.Name = "break"
- w2.Parent = char
- end
- end
- for i,v in pairs(hum.Parent:GetChildren()) do
- if v.Name == "Right Arm" then
- local w3 = Instance.new("Weld")
- w3.Part0 = char["Right Arm"]
- w3.Part1 = v
- w3.Name = "break"
- w3.Parent = char
- end
- end
- for i,v in pairs(hum.Parent:GetChildren()) do
- if v.Name == "Left Arm" then
- local w4 = Instance.new("Weld")
- w4.Part0 = char["Left Arm"]
- w4.Part1 = v
- w4.Name = "break"
- w4.Parent = char
- end
- end
- for i,v in pairs(hum.Parent:GetChildren()) do
- if v.Name == "Right Leg" then
- local w5 = Instance.new("Weld")
- w5.Part0 = char["Right Leg"]
- w5.Part1 = v
- w5.Name = "break"
- w5.Parent = char
- end
- end
- for i,v in pairs(hum.Parent:GetChildren()) do
- if v.Name == "Left Leg" then
- local w6 = Instance.new("Weld")
- w6.Part0 = char["Left Leg"]
- w6.Part1 = v
- w6.Name = "break"
- w6.Parent = char
- end
- end
- hum.PlatformStand = true
- hum.PlatformStand = true
- hum.PlatformStand = true
- hum.PlatformStand = true
- hum.PlatformStand = true
- hum.PlatformStand = true
- char.Head.face.Transparency = 1
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Accessory" or v.ClassName == "Hat" then
- v.Handle.Transparency = 1
- end
- if v.ClassName == "Part" then
- v.Transparency = 1
- end
- end
- end
- end
- ---------------------------------
- -------------Attacks-------------
- ---------------------------------
- Mouse.KeyDown:connect(function(k)
- k = k:lower()
- if k=='z' then
- 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
- control2(Mouse.Target.Parent)
- end
- elseif k=='x' then
- if control == true then
- control = false
- char.Head.face.Transparency = 0
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == "Accessory" or v.ClassName == "Hat" then
- v.Handle.Transparency = 0
- end
- if v.ClassName == "Part" then
- if not(v.Name == "HumanoidRootPart") then
- v.Transparency = 0
- end
- end
- if v.Name == "break" then
- if v.ClassName == "Weld" then
- if v.Part1 ~= nil then
- local hum = v.Part1.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- hum.PlatformStand = false
- v:Destroy()
- end
- end
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement