SHOW:
|
|
- or go back to the newest paste.
| 1 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 2 | local Player,game,owner = owner,game | |
| 3 | local RealPlayer = Player | |
| 4 | do | |
| 5 | print("FE Compatibility code by Mokiros")
| |
| 6 | local rp = RealPlayer | |
| 7 | script.Parent = rp.Character | |
| 8 | ||
| 9 | --RemoteEvent for communicating | |
| 10 | local Event = Instance.new("RemoteEvent")
| |
| 11 | Event.Name = "UserInput_Event" | |
| 12 | ||
| 13 | --Fake event to make stuff like Mouse.KeyDown work | |
| 14 | local function fakeEvent() | |
| 15 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 16 | t.connect = t.Connect | |
| 17 | return t | |
| 18 | end | |
| 19 | ||
| 20 | --Creating fake input objects with fake variables | |
| 21 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
| |
| 22 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 23 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 24 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 25 | end} | |
| 26 | --Merged 2 functions into one by checking amount of arguments | |
| 27 | CAS.UnbindAction = CAS.BindAction | |
| 28 | ||
| 29 | --This function will trigger the events that have been :Connect()'ed | |
| 30 | local function te(self,ev,...) | |
| 31 | local t = m[ev] | |
| 32 | if t and t._fakeEvent then | |
| 33 | for _,f in pairs(t.Functions) do | |
| 34 | f(...) | |
| 35 | end | |
| 36 | end | |
| 37 | end | |
| 38 | m.TrigEvent = te | |
| 39 | UIS.TrigEvent = te | |
| 40 | ||
| 41 | Event.OnServerEvent:Connect(function(plr,io) | |
| 42 | if plr~=rp then return end | |
| 43 | m.Target = io.Target | |
| 44 | m.Hit = io.Hit | |
| 45 | if not io.isMouse then | |
| 46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 49 | end | |
| 50 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
| 51 | return m:TrigEvent(b and "Button2Down" or "Button2Up") | |
| 52 | end | |
| 53 | for _,t in pairs(CAS.Actions) do | |
| 54 | for _,k in pairs(t.Keys) do | |
| 55 | if k==io.KeyCode then | |
| 56 | t.Function(t.Name,io.UserInputState,io) | |
| 57 | end | |
| 58 | end | |
| 59 | end | |
| 60 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 61 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 62 | end | |
| 63 | end) | |
| 64 | Event.Parent = NLS([==[ | |
| 65 | local Player = game:GetService("Players").LocalPlayer
| |
| 66 | local Event = script:WaitForChild("UserInput_Event")
| |
| 67 | local Mouse = Player:GetMouse() | |
| 68 | local UIS = game:GetService("UserInputService")
| |
| 69 | local input = function(io,a) | |
| 70 | if a then return end | |
| 71 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 72 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 73 | end | |
| 74 | UIS.InputBegan:Connect(input) | |
| 75 | UIS.InputEnded:Connect(input) | |
| 76 | local h,t | |
| 77 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 78 | --If player is not moving their mouse, client won't fire events | |
| 79 | while wait(1/30) do | |
| 80 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 81 | h,t=Mouse.Hit,Mouse.Target | |
| 82 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 83 | end | |
| 84 | end]==],Player.Character) | |
| 85 | ||
| 86 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 87 | --Real game object | |
| 88 | local _rg = game | |
| 89 | ||
| 90 | --Metatable for fake service | |
| 91 | local fsmt = {
| |
| 92 | __index = function(self,k) | |
| 93 | local s = rawget(self,"_RealService") | |
| 94 | if s then | |
| 95 | return typeof(s[k])=="function" | |
| 96 | and function(_,...)return s[k](s,...)end or s[k] | |
| 97 | end | |
| 98 | end, | |
| 99 | __newindex = function(self,k,v) | |
| 100 | local s = rawget(self,"_RealService") | |
| 101 | if s then s[k]=v end | |
| 102 | end | |
| 103 | } | |
| 104 | local function FakeService(t,RealService) | |
| 105 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 106 | return setmetatable(t,fsmt) | |
| 107 | end | |
| 108 | ||
| 109 | --Fake game object | |
| 110 | local g = {
| |
| 111 | GetService = function(self,s) | |
| 112 | return rawget(self,s) or _rg:GetService(s) | |
| 113 | end, | |
| 114 | Players = FakeService({
| |
| 115 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 116 | },"Players"), | |
| 117 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 118 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 119 | RunService = FakeService({
| |
| 120 | _btrs = {},
| |
| 121 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 122 | BindToRenderStep = function(self,name,_,fun) | |
| 123 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 124 | end, | |
| 125 | UnbindFromRenderStep = function(self,name) | |
| 126 | self._btrs[name]:Disconnect() | |
| 127 | end, | |
| 128 | },"RunService") | |
| 129 | } | |
| 130 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 131 | g.service = g.GetService | |
| 132 | FakeService(g,game) | |
| 133 | --Changing owner to fake player object to support owner:GetMouse() | |
| 134 | game,owner = g,g.Players.LocalPlayer | |
| 135 | end | |
| 136 | ||
| 137 | function fWeld(zName, zParent, zPart0, zPart1, zCoco, a, b, c, d, e, f) | |
| 138 | local funcw = Instance.new("Weld")
| |
| 139 | funcw.Name = zName | |
| 140 | funcw.Parent = zParent | |
| 141 | funcw.Part0 = zPart0 | |
| 142 | funcw.Part1 = zPart1 | |
| 143 | if (zCoco == true) then | |
| 144 | funcw.C0 = CFrame.new(a, b, c) * CFrame.fromEulerAnglesXYZ(d, e, f) | |
| 145 | else | |
| 146 | funcw.C1 = CFrame.new(a, b, c) * CFrame.fromEulerAnglesXYZ(d, e, f) | |
| 147 | end | |
| 148 | return funcw | |
| 149 | end | |
| 150 | function fun(n1, n2) | |
| 151 | pcall(function() | |
| 152 | t1 = game.Players[n1].Character.Torso | |
| 153 | t2 = game.Players[n2].Character.Torso | |
| 154 | t2.Parent.Humanoid.PlatformStand = true | |
| 155 | t1["Left Shoulder"]:Remove() | |
| 156 | ls1 = Instance.new("Weld")
| |
| 157 | ls1.Parent = t1 | |
| 158 | ls1.Part0 = t1 | |
| 159 | ls1.Part1 = t1.Parent["Left Arm"] | |
| 160 | ls1.C0 = CFrame.new(-1.5,0,0) | |
| 161 | ls1.Name = "Left Shoulder" | |
| 162 | t1["Right Shoulder"]:Remove() | |
| 163 | rs1 = Instance.new("Weld")
| |
| 164 | rs1.Parent = t1 | |
| 165 | rs1.Part0 = t1 | |
| 166 | rs1.Part1 = t1.Parent["Right Arm"] | |
| 167 | rs1.C0 = CFrame.new(1.5,0,0) | |
| 168 | rs1.Name = "Right Shoulder" | |
| 169 | t2["Left Shoulder"]:Remove() | |
| 170 | - | fun("Charlie", "Customality") |
| 170 | + | |
| 171 | ls2.Parent = t2 | |
| 172 | ls2.Part0 = t2 | |
| 173 | ls2.Part1 = t2.Parent["Left Arm"] | |
| 174 | ls2.C0 = CFrame.new(-1.5,0,0) | |
| 175 | ls2.Name = "Left Shoulder" | |
| 176 | t2["Right Shoulder"]:Remove() | |
| 177 | rs2 = Instance.new("Weld")
| |
| 178 | rs2.Parent = t2 | |
| 179 | rs2.Part0 = t2 | |
| 180 | rs2.Part1 = t2.Parent["Right Arm"] | |
| 181 | rs2.C0 = CFrame.new(1.5,0,0) | |
| 182 | rs2.Name = "Right Shoulder" | |
| 183 | t2["Left Hip"]:Remove() | |
| 184 | lh2 = Instance.new("Weld")
| |
| 185 | lh2.Parent = t2 | |
| 186 | lh2.Part0 = t2 | |
| 187 | lh2.Part1 = t2.Parent["Left Leg"] | |
| 188 | lh2.C0 = CFrame.new(-0.5,-2,0) | |
| 189 | lh2.Name = "Left Hip" | |
| 190 | t2["Right Hip"]:Remove() | |
| 191 | rh2 = Instance.new("Weld")
| |
| 192 | rh2.Parent = t2 | |
| 193 | rh2.Part0 = t2 | |
| 194 | rh2.Part1 = t2.Parent["Right Leg"] | |
| 195 | rh2.C0 = CFrame.new(0.5,-2,0) | |
| 196 | rh2.Name = "Right Hip" | |
| 197 | local d = Instance.new("Part")
| |
| 198 | d.TopSurface = 0 | |
| 199 | d.BottomSurface = 0 | |
| 200 | d.CanCollide = false | |
| 201 | d.BrickColor = BrickColor.new("Medium stone grey")
| |
| 202 | d.Shape = "Ball" | |
| 203 | d.Parent = t1 | |
| 204 | d.Size = Vector3.new(1,1,1) | |
| 205 | local dm = Instance.new("SpecialMesh")
| |
| 206 | dm.MeshType = "Sphere" | |
| 207 | dm.Parent = d | |
| 208 | dm.Scale = Vector3.new(0.4,0.4,0.4) | |
| 209 | fWeld("weld",t1,t1,d,true,-0.2,-1.3,-0.6,0,0,0)
| |
| 210 | d2 = d:Clone() | |
| 211 | d2.Parent = t1 | |
| 212 | fWeld("weld",t1,t1,d2,true,0.2,-1.3,-0.6,0,0,0)
| |
| 213 | local c = Instance.new("Part")
| |
| 214 | c.TopSurface = 0 | |
| 215 | c.BottomSurface = 0 | |
| 216 | c.CanCollide = false | |
| 217 | c.BrickColor = BrickColor.new("Pastel brown")
| |
| 218 | c.Parent = t1 | |
| 219 | c.formFactor = "Custom" | |
| 220 | c.Size = Vector3.new(0.4,1.3,0.4) | |
| 221 | cm = Instance.new("CylinderMesh")
| |
| 222 | cm.Parent = c | |
| 223 | a = fWeld("weld",t1,t1,c,true,0,-1,-0.52+(-c.Size.y/2),math.rad(-80),0,0)
| |
| 224 | c2 = d:Clone() | |
| 225 | c2.BrickColor = BrickColor.new("Medium stone grey")
| |
| 226 | c2.Mesh.Scale = Vector3.new(0.4,0.62,0.4) | |
| 227 | c2.Parent = t1 | |
| 228 | fWeld("weld",c,c,c2,true,0,0+(c.Size.y/2),0,math.rad(-10),0,0)
| |
| 229 | local bl = Instance.new("Part")
| |
| 230 | bl.TopSurface = 0 | |
| 231 | bl.BottomSurface = 0 | |
| 232 | bl.CanCollide = false | |
| 233 | bl.BrickColor = BrickColor.new("Pastel brown")
| |
| 234 | bl.Shape = "Ball" | |
| 235 | bl.Parent = t2 | |
| 236 | bl.Size = Vector3.new(1,1,1) | |
| 237 | local dm = Instance.new("SpecialMesh")
| |
| 238 | dm.MeshType = "Sphere" | |
| 239 | dm.Parent = bl | |
| 240 | dm.Scale = Vector3.new(1.2,1.2,1.2) | |
| 241 | fWeld("weld",t2,t2,bl,true,-0.5,0.5,-0.6,0,0,0)
| |
| 242 | local br = Instance.new("Part")
| |
| 243 | br.TopSurface = 0 | |
| 244 | br.BottomSurface = 0 | |
| 245 | br.CanCollide = false | |
| 246 | br.BrickColor = BrickColor.new("Pastel brown")
| |
| 247 | br.Shape = "Ball" | |
| 248 | br.Parent = t2 | |
| 249 | br.Size = Vector3.new(1,1,1) | |
| 250 | local dm = Instance.new("SpecialMesh")
| |
| 251 | dm.MeshType = "Sphere" | |
| 252 | dm.Parent = br | |
| 253 | dm.Scale = Vector3.new(1.2,1.2,1.2) | |
| 254 | fWeld("weld",t2,t2,br,true,0.5,0.5,-0.6,0,0,0)
| |
| 255 | local bln = Instance.new("Part")
| |
| 256 | bln.TopSurface = 0 | |
| 257 | bln.BottomSurface = 0 | |
| 258 | bln.CanCollide = false | |
| 259 | bln.Shape = "Ball" | |
| 260 | bln.Parent = t2 | |
| 261 | bln.Size = Vector3.new(1,1,1) | |
| 262 | local dm = Instance.new("SpecialMesh")
| |
| 263 | dm.MeshType = "Sphere" | |
| 264 | dm.Parent = bln | |
| 265 | dm.Scale = Vector3.new(0.2,0.2,0.2) | |
| 266 | fWeld("weld",t2,t2,bln,true,-0.5,0.5,-1.2,0,0,0)
| |
| 267 | local brn = Instance.new("Part")
| |
| 268 | brn.TopSurface = 0 | |
| 269 | brn.BottomSurface = 0 | |
| 270 | brn.CanCollide = false | |
| 271 | brn.Shape = "Ball" | |
| 272 | brn.Parent = t2 | |
| 273 | brn.Size = Vector3.new(1,1,1) | |
| 274 | local dm = Instance.new("SpecialMesh")
| |
| 275 | dm.MeshType = "Sphere" | |
| 276 | dm.Parent = brn | |
| 277 | dm.Scale = Vector3.new(0.2,0.2,0.2) | |
| 278 | fWeld("weld",t2,t2,brn,true,0.5,0.5,-1.2,0,0,0)
| |
| 279 | lh2.C1 = CFrame.new(0,-1.5,-0.5) * CFrame.Angles(0.9,-0.4,0) | |
| 280 | rh2.C1 = CFrame.new(0,-1.5,-0.5) * CFrame.Angles(0.9,0.4,0) | |
| 281 | ls2.C1 = CFrame.new(-0.5,-1.3,-0.5) * CFrame.Angles(0.9,-0.4,0) | |
| 282 | rs2.C1 = CFrame.new(0.5,-1.3,-0.5) * CFrame.Angles(0.9,0.4,0) | |
| 283 | ls1.C1 = CFrame.new(-0.5,0.7,0) * CFrame.Angles(-0.9,-0.4,0) | |
| 284 | rs1.C1 = CFrame.new(0.5,0.7,0) * CFrame.Angles(-0.9,0.4,0) | |
| 285 | if t1:findFirstChild("weldx") ~= nil then
| |
| 286 | t1.weldx:Remove() | |
| 287 | end | |
| 288 | we = fWeld("weldx", t1, t1, t2, true, 0, -0.9, -1.3, math.rad(-90), 0, 0)
| |
| 289 | n = t2.Neck | |
| 290 | n.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.rad(-210), math.rad(180), 0) | |
| 291 | end) | |
| 292 | coroutine.resume(coroutine.create(function() | |
| 293 | while wait() do | |
| 294 | for i = 1,6 do | |
| 295 | we.C1 = we.C1 * CFrame.new(0,-0.3,0) | |
| 296 | wait() | |
| 297 | end | |
| 298 | ||
| 299 | for i = 1,6 do | |
| 300 | we.C1 = we.C1 * CFrame.new(0,0.3,0) | |
| 301 | wait() | |
| 302 | end | |
| 303 | end | |
| 304 | end)) | |
| 305 | end | |
| 306 | fun("74Zahira", "TyTyroy09") |