SHOW:
|
|
- or go back to the newest paste.
| 1 | --just put this on the top of a script and boom 89% works | |
| 2 | --note this does not work on big scripts | |
| 3 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 4 | local Player,game,owner = owner,game | |
| 5 | local RealPlayer = Player | |
| 6 | do | |
| 7 | local rp = RealPlayer | |
| 8 | script.Parent = rp.Character | |
| 9 | ||
| 10 | --RemoteEvent for communicating | |
| 11 | local Event = Instance.new("RemoteEvent")
| |
| 12 | Event.Name = "UserInput_Event" | |
| 13 | ||
| 14 | --Fake event to make stuff like Mouse.KeyDown work | |
| 15 | local function fakeEvent() | |
| 16 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 17 | t.connect = t.Connect | |
| 18 | return t | |
| 19 | end | |
| 20 | ||
| 21 | --Creating fake input objects with fake variables | |
| 22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 26 | end} | |
| 27 | --Merged 2 functions into one by checking amount of arguments | |
| 28 | CAS.UnbindAction = CAS.BindAction | |
| 29 | ||
| 30 | --This function will trigger the events that have been :Connect()'ed | |
| 31 | local function te(self,ev,...) | |
| 32 | local t = m[ev] | |
| 33 | if t and t._fakeEvent then | |
| 34 | for _,f in pairs(t.Functions) do | |
| 35 | f(...) | |
| 36 | end | |
| 37 | end | |
| 38 | end | |
| 39 | m.TrigEvent = te | |
| 40 | UIS.TrigEvent = te | |
| 41 | ||
| 42 | Event.OnServerEvent:Connect(function(plr,io) | |
| 43 | if plr~=rp then return end | |
| 44 | m.Target = io.Target | |
| 45 | m.Hit = io.Hit | |
| 46 | - | Part0.Size = Vector3.new(0.48999998, 2.96999931, 1.94999981) |
| 46 | + | if not io.isMouse then |
| 47 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 48 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 49 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 50 | end | |
| 51 | for _,t in pairs(CAS.Actions) do | |
| 52 | for _,k in pairs(t.Keys) do | |
| 53 | if k==io.KeyCode then | |
| 54 | - | SpecialMesh1.MeshId = "rbxassetid://441572308" |
| 54 | + | t.Function(t.Name,io.UserInputState,io) |
| 55 | - | SpecialMesh1.Scale = Vector3.new(0.0209999997, 0.0209999997, 0.0209999997) |
| 55 | + | |
| 56 | - | SpecialMesh1.TextureId = "rbxassetid://441572332" |
| 56 | + | end |
| 57 | end | |
| 58 | - | SpecialMesh1.Scale = Vector3.new(0.0209999997, 0.0209999997, 0.0209999997) |
| 58 | + | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
| 59 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 60 | end | |
| 61 | end) | |
| 62 | Event.Parent = NLS([==[ | |
| 63 | local Player = game:GetService("Players").LocalPlayer
| |
| 64 | local Event = script:WaitForChild("UserInput_Event")
| |
| 65 | ||
| 66 | local Mouse = Player:GetMouse() | |
| 67 | local UIS = game:GetService("UserInputService")
| |
| 68 | local input = function(io,a) | |
| 69 | if a then return end | |
| 70 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 71 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 72 | end | |
| 73 | UIS.InputBegan:Connect(input) | |
| 74 | UIS.InputEnded:Connect(input) | |
| 75 | ||
| 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 return s[k] end | |
| 95 | end, | |
| 96 | __newindex = function(self,k,v) | |
| 97 | local s = rawget(self,"_RealService") | |
| 98 | if s then s[k]=v end | |
| 99 | end, | |
| 100 | __call = function(self,...) | |
| 101 | local s = rawget(self,"_RealService") | |
| 102 | if s then return s(...) end | |
| 103 | end | |
| 104 | } | |
| 105 | local function FakeService(t,RealService) | |
| 106 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 107 | return setmetatable(t,fsmt) | |
| 108 | end | |
| 109 | ||
| 110 | --Fake game object | |
| 111 | local g = {
| |
| 112 | GetService = function(self,s) | |
| 113 | return self[s] | |
| 114 | end, | |
| 115 | Players = FakeService({
| |
| 116 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 117 | },"Players"), | |
| 118 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 119 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 120 | } | |
| 121 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 122 | g.service = g.GetService | |
| 123 | ||
| 124 | g.RunService = FakeService({
| |
| 125 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 126 | BindToRenderStep = function(self,name,_,fun) | |
| 127 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 128 | end, | |
| 129 | UnbindFromRenderStep = function(self,name) | |
| 130 | self._btrs[name]:Disconnect() | |
| 131 | end, | |
| 132 | },"RunService") | |
| 133 | ||
| 134 | setmetatable(g,{
| |
| 135 | __index=function(self,s) | |
| 136 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 137 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 138 | end, | |
| 139 | __newindex = fsmt.__newindex, | |
| 140 | __call = fsmt.__call | |
| 141 | }) | |
| 142 | --Changing owner to fake player object to support owner:GetMouse() | |
| 143 | game,owner = g,g.Players.LocalPlayer | |
| 144 | end | |
| 145 | ||
| 146 | ||
| 147 | ||
| 148 | --By Ruffles14 | |
| 149 | mouse = game.Players.LocalPlayer:GetMouse() | |
| 150 | local rhandclone = game.Players.LocalPlayer.Character.Torso["Right Shoulder"]:Clone() | |
| 151 | local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
| |
| 152 | rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso | |
| 153 | rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"] | |
| 154 | rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1) | |
| 155 | local lhandclone = game.Players.LocalPlayer.Character.Torso["Left Shoulder"]:Clone() | |
| 156 | local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
| |
| 157 | lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso | |
| 158 | lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"] | |
| 159 | lhandweld.C0 = CFrame.new(-1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1) | |
| 160 | local rootjointclone = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint:Clone() | |
| 161 | game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint:Remove() | |
| 162 | local humanoidrootpart = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
| |
| 163 | humanoidrootpart.Part0 = game.Players.LocalPlayer.Character.HumanoidRootPart | |
| 164 | humanoidrootpart.Part1 = game.Players.LocalPlayer.Character.Torso | |
| 165 | local heed = game.Players.LocalPlayer.Character.Torso["Neck"]:Clone() | |
| 166 | local headweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
| |
| 167 | headweld.Part0 = game.Players.LocalPlayer.Character.Torso | |
| 168 | headweld.Part1 = game.Players.LocalPlayer.Character.Head | |
| 169 | headweld.C0 = headweld.C0 * CFrame.new(0,1.5,0) | |
| 170 | game.Players.LocalPlayer.Character.Torso.Neck:Remove() | |
| 171 | using = false | |
| 172 | --Converted with ttyyuu12345's model to script plugin v4 | |
| 173 | function sandbox(var,func) | |
| 174 | local env = getfenv(func) | |
| 175 | local newenv = setmetatable({},{
| |
| 176 | __index = function(self,k) | |
| 177 | if k=="script" then | |
| 178 | return var | |
| 179 | else | |
| 180 | return env[k] | |
| 181 | end | |
| 182 | end, | |
| 183 | }) | |
| 184 | setfenv(func,newenv) | |
| 185 | return func | |
| 186 | end | |
| 187 | cors = {}
| |
| 188 | mas = Instance.new("Model",game:GetService("Lighting"))
| |
| 189 | Part0 = Instance.new("Part")
| |
| 190 | SpecialMesh1 = Instance.new("SpecialMesh")
| |
| 191 | Part0.Parent = mas | |
| 192 | Part0.Rotation = Vector3.new(-17.039999, 72.0800018, -73.7399979) | |
| 193 | Part0.Size = Vector3.new(2, 2, 2) | |
| 194 | Part0.CFrame = CFrame.new(1.99671245, 4.08856773, -0.616976917, 0.0861581191, 0.29545939, 0.95146209, -0.99592489, 0, 0.090184398, 0.0266458243, -0.955355108, 0.294255406) | |
| 195 | Part0.BottomSurface = Enum.SurfaceType.Smooth | |
| 196 | Part0.TopSurface = Enum.SurfaceType.Smooth | |
| 197 | Part0.Position = Vector3.new(1.99671245, 4.08856773, -0.616976917) | |
| 198 | Part0.Orientation = Vector3.new(-5.17000008, 72.8099976, -90) | |
| 199 | Part0.CanCollide = false | |
| 200 | SpecialMesh1.Parent = Part0 | |
| 201 | SpecialMesh1.MeshId = "rbxassetid://596146679" | |
| 202 | SpecialMesh1.Scale = Vector3.new(.05, .05, .05) | |
| 203 | SpecialMesh1.TextureId = "rbxassetid://000000" | |
| 204 | SpecialMesh1.MeshType = Enum.MeshType.FileMesh | |
| 205 | SpecialMesh1.Scale = Vector3.new(.05, .05, .05) | |
| 206 | for i,v in pairs(mas:GetChildren()) do | |
| 207 | v.Parent = game:GetService("Players").LocalPlayer.Character
| |
| 208 | pcall(function() v:MakeJoints() end) | |
| 209 | end | |
| 210 | mas:Destroy() | |
| 211 | for i,v in pairs(cors) do | |
| 212 | spawn(function() | |
| 213 | pcall(v) | |
| 214 | end) | |
| 215 | end | |
| 216 | Part0:BreakJoints() | |
| 217 | cananimate = true | |
| 218 | canhit = false | |
| 219 | local weld = Instance.new("Weld", game.Players.LocalPlayer.Character["Right Arm"])
| |
| 220 | weld.Part0 = game.Players.LocalPlayer.Character["Right Arm"] | |
| 221 | weld.Part1 = Part0 | |
| 222 | weld.C0 = CFrame.new(0.0769970417, -1.17027426, -1.17937994, 0, 0, 1, -0.999999881, 0, 0, 0, -1, 0) | |
| 223 | for i = 0,1 , 0.03 do | |
| 224 | headweld.C0 = headweld.C0:lerp(CFrame.new(0, 1.5, 0, 0.962374032, 0, 0.271727562, 0, 1, 0, -0.271727562, 0, 0.962374032),i) | |
| 225 | humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0, 0, 0, 0.955355227, 0, -0.295459419, 0, 1, 0, 0.295459419, 0, 0.955355227),i) | |
| 226 | lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.53559077, 0.0383267403, 0, 0.997264206, 0.0739177391, 0, -0.0739177391, 0.997264266, 0, 2.98023224e-08, 1.86264515e-09, 0.999999881),i) | |
| 227 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.54305458, 0.047129631, 2.98023224e-08, 0.99592495, -0.0901843905, 0, 0.090184398, 0.995925009, 0, 0, 0, 0.999999881),i) | |
| 228 | game:GetService("RunService").RenderStepped:wait()
| |
| 229 | end | |
| 230 | function swing() | |
| 231 | if not using then | |
| 232 | using = true | |
| 233 | cananimate = false | |
| 234 | for i = 0,1 , 0.045 do | |
| 235 | weld.C0 = weld.C0:lerp(CFrame.new(0.958130836, -0.815908253, -0.0419664383, 0.379335552, 0.92491132, -0.0253674984, -0.913223445, 0.378668189, 0.150445476, 0.148754537, -0.0339030921, 0.988292694),i) | |
| 236 | headweld.C0 = headweld.C0:lerp(CFrame.new(-4.65661287e-10, 1.49999952, 0, 0.601507425, -2.32830644e-10, 0.798867226, 3.0559022e-10, 1, 0, -0.798867226, -4.65661287e-10, 0.601507425),i) | |
| 237 | humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0, 0, 0, 0.63088727, -0.00573391188, -0.775853336, 0, 0.999972701, -0.00739025697, 0.775874496, 0.00466241874, 0.630870044),i) | |
| 238 | lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(0.0363237262, 0.350219727, -1.1563791, 0.495106995, -0.857149601, 0.1419992, 0.110766649, -0.0998312235, -0.988819599, 0.861742377, 0.505300522, 0.0455164276),i) | |
| 239 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.50056481, 0.516354084, -0.499166548, 0.995925009, -0.00520473719, 0.09003409, 0.0901844054, 0.0574772507, -0.994265079, -2.98023224e-08, 0.998333335, 0.057712432),i) | |
| 240 | game:GetService("RunService").RenderStepped:wait()
| |
| 241 | end | |
| 242 | canhit = true | |
| 243 | for i = 0,1 , 0.08 do | |
| 244 | weld.C0 = weld.C0:lerp(CFrame.new(0.968596578, -1.15575922, 0.178524971, 0.0531506836, 0.988890588, -0.13881819, -0.988834679, 0.0327400565, -0.145376131, -0.13921617, 0.144995078, 0.979589343),i) | |
| 245 | headweld.C0 = headweld.C0:lerp(CFrame.new(-0.0249017328, 1.48724031, 2.04332173e-06, 0.499998868, 0, -0.866026163, 0, 1, 0, 0.866026163, 0, 0.499998868),i) | |
| 246 | humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0, 0, 0, 0.305942208, 0, -0.952050149, 0, 1, 0, 0.952050149, 0, 0.305942208):inverse(),i) | |
| 247 | lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.07653618, 0.305679321, -0.818206966, 0.707105398, -0.707108259, 4.32133675e-07, 0.122787982, 0.122786887, -0.984807909, 0.696365714, 0.696363032, 0.173647687),i) | |
| 248 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.74788636, 0.363031864, -0.7663396, 0.70710665, 0.707106948, -2.23517418e-08, -0.0616280138, 0.061627958, -0.99619478, -0.704416275, 0.704416037, 0.0871551335),i) | |
| 249 | game:GetService("RunService").RenderStepped:wait()
| |
| 250 | end | |
| 251 | canhit = false | |
| 252 | - | hitsound.Volume = math.random(5,10) |
| 252 | + | |
| 253 | cananimate = true | |
| 254 | end | |
| 255 | end | |
| 256 | mouse.Button1Down:connect(swing) | |
| 257 | function hittie(part) | |
| 258 | if canhit then | |
| 259 | local humanoid = part.Parent:findFirstChildOfClass("Humanoid")
| |
| 260 | if humanoid then | |
| 261 | canhit = false | |
| 262 | using = false | |
| 263 | local uptor = humanoid.Parent:findFirstChild("UpperTorso")
| |
| 264 | if uptor and uptor.Parent.Name ~= game.Players.LocalPlayer.Name then | |
| 265 | humanoid.Parent:BreakJoints() | |
| 266 | while humanoid.Health >= 0.001 do | |
| 267 | game:GetService("RunService").RenderStepped:wait()
| |
| 268 | end | |
| 269 | if humanoid.Parent:findFirstChild("HumanoidRootPart") then
| |
| 270 | humanoid.Parent.HumanoidRootPart.CanCollide = false | |
| 271 | end | |
| 272 | local function makeballlimb(attachone, attachtwo, upperang, lowang, twist) | |
| 273 | local constraint = Instance.new("BallSocketConstraint", humanoid.Parent)
| |
| 274 | constraint.Attachment0 = attachone | |
| 275 | constraint.Attachment1 = attachtwo | |
| 276 | constraint.LimitsEnabled = true | |
| 277 | constraint.TwistLimitsEnabled = true | |
| 278 | constraint.TwistLowerAngle = lowang | |
| 279 | constraint.TwistUpperAngle = upperang | |
| 280 | constraint.UpperAngle = twist | |
| 281 | end | |
| 282 | local function makehingelimb(attachone, attachtwo, upperang, lowang) | |
| 283 | local constraint = Instance.new("HingeConstraint", humanoid.Parent)
| |
| 284 | constraint.Attachment0 = attachone | |
| 285 | constraint.Attachment1 = attachtwo | |
| 286 | constraint.LimitsEnabled = true | |
| 287 | constraint.LowerAngle = lowang | |
| 288 | constraint.UpperAngle = upperang | |
| 289 | end | |
| 290 | for i,v in pairs(humanoid.Parent:GetChildren()) do --scan player | |
| 291 | if v.ClassName == "Accessory" then | |
| 292 | local findhandle = v:findFirstChild("Handle") --finding handle in accesorry
| |
| 293 | if findhandle then | |
| 294 | local attach = findhandle:findFirstChildOfClass("Attachment")
| |
| 295 | for q,w in pairs(humanoid.Parent:GetChildren()) do --scan player | |
| 296 | if w.Name == "UpperTorso" or w.Name == "Head" then | |
| 297 | attach1 = w:findFirstChild(attach.Name) --finding attachment in head/uppertorso | |
| 298 | end | |
| 299 | end | |
| 300 | if attach and attach1 then | |
| 301 | local constraint = Instance.new("HingeConstraint", humanoid.Parent) --making fake weld
| |
| 302 | constraint.Attachment0 = attach | |
| 303 | - | hitsound.Volume = math.random(5,10) |
| 303 | + | |
| 304 | constraint.LimitsEnabled = true | |
| 305 | constraint.LowerAngle = 0 | |
| 306 | constraint.UpperAngle = 0 | |
| 307 | end | |
| 308 | end | |
| 309 | end | |
| 310 | end | |
| 311 | if humanoid.Parent:findFirstChild("Head") and humanoid.Parent:findFirstChild("UpperTorso") then
| |
| 312 | local attachment = Instance.new("Attachment", humanoid.Parent.Head)
| |
| 313 | attachment.Position = Vector3.new(0, -0.5, 0) | |
| 314 | attachment.Name = "lol" | |
| 315 | attachment.Visible = false | |
| 316 | humanoid.Parent.UpperTorso.NeckAttachment.Visible = false | |
| 317 | humanoid.Parent.UpperTorso.NeckAttachment.Position = humanoid.Parent.UpperTorso.NeckAttachment.Position + Vector3.new(0,0,0) | |
| 318 | local ball = Instance.new("BallSocketConstraint", humanoid.Parent)
| |
| 319 | ball.Attachment0 = humanoid.Parent.UpperTorso.NeckAttachment | |
| 320 | ball.Attachment1 = attachment | |
| 321 | ball.LimitsEnabled = true | |
| 322 | ball.TwistLimitsEnabled = true | |
| 323 | ball.UpperAngle = 40 | |
| 324 | ball.Restitution = 0.5 | |
| 325 | ball.TwistUpperAngle = 40 | |
| 326 | ball.TwistLowerAngle = -40 | |
| 327 | local collidepartofleftleg = Instance.new("Part", humanoid.Parent.UpperTorso)
| |
| 328 | collidepartofleftleg.Name = "Bone" | |
| 329 | collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7) | |
| 330 | collidepartofleftleg.Transparency = 1 | |
| 331 | collidepartofleftleg:BreakJoints() | |
| 332 | local weeld = Instance.new("Weld", collidepartofleftleg)
| |
| 333 | weeld.Part0 = collidepartofleftleg | |
| 334 | weeld.Part1 = humanoid.Parent["Head"] | |
| 335 | if humanoid.Parent.Head:findFirstChild("Neck") then
| |
| 336 | humanoid.Parent.Head.Neck:destroy() | |
| 337 | end | |
| 338 | if humanoid.Parent.Head:findFirstChild("face") then
| |
| 339 | humanoid.Parent.Head.face.Texture = "http://www.roblox.com/asset/?id=810245460" | |
| 340 | end | |
| 341 | end | |
| 342 | local LeftUpperLeg = humanoid.Parent:findFirstChild("LeftUpperLeg")
| |
| 343 | local LeftLowerLeg = humanoid.Parent:findFirstChild("LeftLowerLeg")
| |
| 344 | -- | |
| 345 | local RightUpperLeg = humanoid.Parent:findFirstChild("RightUpperLeg")
| |
| 346 | local RightLowerLeg = humanoid.Parent:findFirstChild("RightLowerLeg")
| |
| 347 | -- | |
| 348 | local RightUpperArm = humanoid.Parent:findFirstChild("RightUpperArm")
| |
| 349 | local RightLowerArm = humanoid.Parent:findFirstChild("RightLowerArm")
| |
| 350 | -- | |
| 351 | local LeftUpperArm = humanoid.Parent:findFirstChild("LeftUpperArm")
| |
| 352 | local LeftLowerArm = humanoid.Parent:findFirstChild("LeftLowerArm")
| |
| 353 | --Foot & Hands-- | |
| 354 | ||
| 355 | local LeftFoot = humanoid.Parent:findFirstChild("LeftFoot")
| |
| 356 | local RightFoot = humanoid.Parent:findFirstChild("RightFoot")
| |
| 357 | -- | |
| 358 | local LeftHand = humanoid.Parent:findFirstChild("LeftHand")
| |
| 359 | local RightHand = humanoid.Parent:findFirstChild("RightHand")
| |
| 360 | ||
| 361 | --END-- | |
| 362 | --TORSOS-- | |
| 363 | ||
| 364 | local UpperTorso = humanoid.Parent:findFirstChild("UpperTorso")
| |
| 365 | local LowerTorso = humanoid.Parent:findFirstChild("LowerTorso")
| |
| 366 | ||
| 367 | --END-- | |
| 368 | if LowerTorso then | |
| 369 | if LeftUpperLeg then | |
| 370 | makeballlimb(LowerTorso["LeftHipRigAttachment"], LeftUpperLeg["LeftHipRigAttachment"], 50,-50, 90) | |
| 371 | end | |
| 372 | if RightUpperLeg then | |
| 373 | makeballlimb(LowerTorso["RightHipRigAttachment"], RightUpperLeg["RightHipRigAttachment"], 50,-50, 90) | |
| 374 | end | |
| 375 | if LeftLowerLeg then | |
| 376 | makehingelimb(LeftUpperLeg["LeftKneeRigAttachment"], LeftLowerLeg["LeftKneeRigAttachment"], 0,-90) | |
| 377 | end | |
| 378 | if RightLowerLeg then | |
| 379 | makehingelimb(RightUpperLeg["RightKneeRigAttachment"], RightLowerLeg["RightKneeRigAttachment"], 0,-90) | |
| 380 | end | |
| 381 | if LeftFoot then | |
| 382 | makehingelimb(LeftLowerLeg["LeftAnkleRigAttachment"], LeftFoot["LeftAnkleRigAttachment"], 30, -30) | |
| 383 | end | |
| 384 | if RightFoot then | |
| 385 | makehingelimb(RightLowerLeg["RightAnkleRigAttachment"], RightFoot["RightAnkleRigAttachment"], 30, -30) | |
| 386 | end | |
| 387 | if UpperTorso then | |
| 388 | makehingelimb(UpperTorso["WaistRigAttachment"], LowerTorso["WaistRigAttachment"], 30, -30) | |
| 389 | end | |
| 390 | end | |
| 391 | if UpperTorso then | |
| 392 | local vel = Instance.new("BodyVelocity", UpperTorso)
| |
| 393 | vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 394 | vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 10 | |
| 395 | game.Debris:AddItem(vel, 0.1) | |
| 396 | local hitsound = Instance.new("Sound", UpperTorso)
| |
| 397 | hitsound.SoundId = "http://www.roblox.com/asset/?id=148862502" | |
| 398 | hitsound:Play() | |
| 399 | hitsound.Volume = math.random(0,0) | |
| 400 | local canhit = true | |
| 401 | local hitval = 15 | |
| 402 | local uptor = humanoid.Parent.UpperTorso | |
| 403 | if RightUpperArm then | |
| 404 | makeballlimb(RightUpperArm["RightShoulderRigAttachment"], UpperTorso["RightShoulderRigAttachment"], 90,-50, 180) | |
| 405 | end | |
| 406 | if RightLowerArm then | |
| 407 | makehingelimb(RightLowerArm["RightElbowRigAttachment"], RightUpperArm["RightElbowRigAttachment"], 0,-90) | |
| 408 | end | |
| 409 | if RightHand then | |
| 410 | makehingelimb(RightHand["RightWristRigAttachment"], RightLowerArm["RightWristRigAttachment"], 30,30) | |
| 411 | end | |
| 412 | if LeftUpperArm then | |
| 413 | makeballlimb(LeftUpperArm["LeftShoulderRigAttachment"], UpperTorso["LeftShoulderRigAttachment"], 90,-50, 180) | |
| 414 | end | |
| 415 | if LeftLowerArm then | |
| 416 | makehingelimb(LeftLowerArm["LeftElbowRigAttachment"], LeftUpperArm["LeftElbowRigAttachment"], 0,-90) | |
| 417 | end | |
| 418 | if LeftHand then | |
| 419 | makehingelimb(LeftHand["LeftWristRigAttachment"], LeftLowerArm["LeftWristRigAttachment"], 30,30) | |
| 420 | end | |
| 421 | end | |
| 422 | else | |
| 423 | humanoid.Parent.Archivable = true | |
| 424 | humanoid.PlatformStand = true | |
| 425 | local clone = humanoid.Parent:Clone() | |
| 426 | clone.Parent = workspace | |
| 427 | game.Debris:AddItem(clone, 60) | |
| 428 | for i,v in pairs(clone:GetChildren()) do | |
| 429 | if v.ClassName == "Script" or v.ClassName == "LocalScript" then | |
| 430 | v:Remove() | |
| 431 | end | |
| 432 | for i,p in pairs(v:GetChildren()) do | |
| 433 | if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then | |
| 434 | p:Remove() | |
| 435 | end | |
| 436 | end | |
| 437 | end | |
| 438 | for i,t in pairs(humanoid.Parent:GetChildren()) do | |
| 439 | if t.ClassName == "Accessory" or t.ClassName == "ForceField" then | |
| 440 | t:Remove() | |
| 441 | end | |
| 442 | end | |
| 443 | local vel = Instance.new("BodyVelocity", clone.Torso)
| |
| 444 | vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 445 | vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 15 | |
| 446 | game.Debris:AddItem(vel, 0.1) | |
| 447 | local hitsound = Instance.new("Sound", clone.Torso)
| |
| 448 | hitsound.SoundId = "http://www.roblox.com/asset/?id=148862502" | |
| 449 | hitsound:Play() | |
| 450 | hitsound.Volume = math.random(0,0) | |
| 451 | vel = Instance.new("BodyVelocity", clone.Torso)
| |
| 452 | vel.Velocity = clone.Torso.CFrame.lookVector * -5 | |
| 453 | vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 454 | using = false | |
| 455 | hit = Instance.new("Sound", clone.Torso)
| |
| 456 | hit.SoundId = "rbxassetid://260430060" | |
| 457 | hit.Volume = 0 | |
| 458 | hit1 = Instance.new("Sound", clone.Torso)
| |
| 459 | hit1.SoundId = "rbxassetid://138087186" | |
| 460 | hit1.Volume = 0 | |
| 461 | hit2 = Instance.new("Sound", clone.Torso)
| |
| 462 | hit2.SoundId = "rbxassetid://131237241" | |
| 463 | hit2.Volume = 0 | |
| 464 | hit3 = Instance.new("Sound", clone.Torso)
| |
| 465 | hit3.SoundId = "rbxassetid://278062209" | |
| 466 | hit3.Volume = 0 | |
| 467 | hit3.TimePosition = 0.33 | |
| 468 | ded = Instance.new("Sound", clone.Torso)
| |
| 469 | ded.SoundId = "rbxassetid://418892870" | |
| 470 | ded.Volume = 0 | |
| 471 | local leftarm = clone:findFirstChild("Left Arm")
| |
| 472 | local rightrm = clone:findFirstChild("Right Arm")
| |
| 473 | local leftleg = clone:findFirstChild("Left Leg")
| |
| 474 | local rightleg = clone:findFirstChild("Right Leg")
| |
| 475 | local head = clone:findFirstChild("Head")
| |
| 476 | for i, g in pairs(humanoid.Parent:GetChildren()) do | |
| 477 | if g.ClassName == "Part" then | |
| 478 | g:destroy() | |
| 479 | end | |
| 480 | end | |
| 481 | for i, h in pairs(humanoid.Parent:GetChildren()) do | |
| 482 | if h.ClassName == "Accesory" then | |
| 483 | h:destroy() | |
| 484 | end | |
| 485 | end | |
| 486 | for z,x in pairs(clone:GetChildren()) do | |
| 487 | if x.ClassName == "Accessory" then | |
| 488 | local handle = x:findFirstChild("Handle")
| |
| 489 | if handle then | |
| 490 | local attachment = handle:findFirstChildOfClass("Attachment")
| |
| 491 | if attachment then | |
| 492 | for q,w in pairs(clone:GetChildren()) do | |
| 493 | if w.Name == "Torso" or w.Name == "Head" then | |
| 494 | local anotherone = w:findFirstChild(attachment.Name) | |
| 495 | if attachment and anotherone then | |
| 496 | - | clone.Name = humanoid.Parent.Name.." (PANNED)" |
| 496 | + | |
| 497 | constraint.Attachment0 = attachment | |
| 498 | constraint.Attachment1 = anotherone | |
| 499 | constraint.LimitsEnabled = true | |
| 500 | constraint.LowerAngle = 0 | |
| 501 | constraint.UpperAngle = 0 | |
| 502 | end | |
| 503 | end | |
| 504 | end | |
| 505 | end | |
| 506 | end | |
| 507 | end | |
| 508 | end | |
| 509 | if head and clone.Torso:findFirstChild("NeckAttachment") then
| |
| 510 | local attachment = Instance.new("Attachment", clone.Head)
| |
| 511 | attachment.Position = Vector3.new(0, -0.5, 0) | |
| 512 | attachment.Name = "lol" | |
| 513 | attachment.Visible = false | |
| 514 | clone.Torso.NeckAttachment.Visible = false | |
| 515 | clone.Torso.NeckAttachment.Position = clone.Torso.NeckAttachment.Position + Vector3.new(0,0,0) | |
| 516 | local ball = Instance.new("BallSocketConstraint", clone)
| |
| 517 | ball.Attachment0 = clone.Torso.NeckAttachment | |
| 518 | ball.Attachment1 = attachment | |
| 519 | ball.LimitsEnabled = true | |
| 520 | ball.TwistLimitsEnabled = true | |
| 521 | ball.UpperAngle = 90 | |
| 522 | ball.Restitution = 0.5 | |
| 523 | ball.TwistUpperAngle = 90 | |
| 524 | ball.TwistLowerAngle = -90 | |
| 525 | local collidepartofleftleg = Instance.new("Part", clone.Torso)
| |
| 526 | collidepartofleftleg.Name = "Bone" | |
| 527 | collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7) | |
| 528 | collidepartofleftleg.Transparency = 1 | |
| 529 | collidepartofleftleg:BreakJoints() | |
| 530 | local weeld = Instance.new("Weld", collidepartofleftleg)
| |
| 531 | weeld.Part0 = collidepartofleftleg | |
| 532 | weeld.Part1 = clone["Head"] | |
| 533 | end | |
| 534 | if leftleg ~= nil then | |
| 535 | leftleg:BreakJoints() | |
| 536 | local glue = Instance.new("Glue", clone.Torso)
| |
| 537 | glue.Part0 = clone.Torso | |
| 538 | glue.Part1 = leftleg | |
| 539 | glue.Name = "Left leg" | |
| 540 | local collider = Instance.new("Part", leftleg)
| |
| 541 | collider.Position = Vector3.new(0,999,0) | |
| 542 | collider.Size = Vector3.new(1.5, 1, 1) | |
| 543 | collider.Shape = "Cylinder" | |
| 544 | local weld = Instance.new("Weld", collider)
| |
| 545 | weld.Part0 = leftleg | |
| 546 | weld.Part1 = collider | |
| 547 | weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 548 | collider.TopSurface = "Smooth" | |
| 549 | collider.BottomSurface = "Smooth" | |
| 550 | collider.formFactor = "Symmetric" | |
| 551 | glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 552 | glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 553 | collider.Transparency = 1 | |
| 554 | end | |
| 555 | ------------ | |
| 556 | if rightleg ~= nil then | |
| 557 | rightleg:BreakJoints() | |
| 558 | local glue1 = Instance.new("Glue", clone.Torso)
| |
| 559 | glue1.Part0 = clone.Torso | |
| 560 | glue1.Part1 = rightleg | |
| 561 | glue1.Name = "Right leg" | |
| 562 | local collider1 = Instance.new("Part", rightleg)
| |
| 563 | collider1.Position = Vector3.new(0,999,0) | |
| 564 | collider1.Size = Vector3.new(1.5, 1, 1) | |
| 565 | collider1.Shape = "Cylinder" | |
| 566 | local weld1 = Instance.new("Weld", collider1)
| |
| 567 | weld1.Part0 = rightleg | |
| 568 | weld1.Part1 = collider1 | |
| 569 | weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 570 | collider1.TopSurface = "Smooth" | |
| 571 | collider1.BottomSurface = "Smooth" | |
| 572 | - | ded.Volume = 5 |
| 572 | + | |
| 573 | glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 574 | glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 575 | collider1.Transparency = 1 | |
| 576 | end | |
| 577 | ------------ | |
| 578 | if rightrm ~= nil then | |
| 579 | rightrm:BreakJoints() | |
| 580 | rightrm.CFrame = clone.Torso.CFrame * CFrame.new(1.7,0,0) | |
| 581 | local glue11 = Instance.new("Glue", clone.Torso)
| |
| 582 | glue11.Part0 = clone.Torso | |
| 583 | glue11.Part1 = rightrm | |
| 584 | glue11.Name = "Right shoulder" | |
| 585 | local collider11 = Instance.new("Part", rightrm)
| |
| 586 | collider11.Position = Vector3.new(0,9999,0) | |
| 587 | collider11.Size = Vector3.new(1.5,1,1) | |
| 588 | collider11.Shape = "Cylinder" | |
| 589 | local weld11 = Instance.new("Weld", collider11)
| |
| 590 | weld11.Part0 = rightrm | |
| 591 | weld11.Part1 = collider11 | |
| 592 | weld11.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 593 | collider11.TopSurface = "Smooth" | |
| 594 | collider11.BottomSurface = "Smooth" | |
| 595 | collider11.formFactor = "Symmetric" | |
| 596 | glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
| 597 | glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
| 598 | collider11.Transparency = 1 | |
| 599 | end | |
| 600 | ------------ | |
| 601 | if leftarm ~= nil then | |
| 602 | leftarm.CFrame = clone.Torso.CFrame * CFrame.new(-1.7,0,0) | |
| 603 | leftarm:BreakJoints() | |
| 604 | local glue111 = Instance.new("Glue", clone.Torso)
| |
| 605 | glue111.Part0 = clone.Torso | |
| 606 | glue111.Part1 = leftarm | |
| 607 | glue111.Name = "Left shoulder" | |
| 608 | local collider111 = Instance.new("Part", leftarm)
| |
| 609 | collider111.Position = Vector3.new(0,9999,0) | |
| 610 | collider111.Size = Vector3.new(1.5,1,1) | |
| 611 | collider111.Shape = "Cylinder" | |
| 612 | local weld111 = Instance.new("Weld", collider111)
| |
| 613 | weld111.Part0 = leftarm | |
| 614 | weld111.Part1 = collider111 | |
| 615 | weld111.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 616 | collider111.TopSurface = "Smooth" | |
| 617 | collider111.BottomSurface = "Smooth" | |
| 618 | collider111.formFactor = "Symmetric" | |
| 619 | glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
| 620 | glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
| 621 | collider111.Transparency = 1 | |
| 622 | ---------------- | |
| 623 | sensoring = Instance.new("Part", clone.Torso)
| |
| 624 | sensoring.Size = Vector3.new(1.2,1.1,0.8) | |
| 625 | sensoring.CanCollide = false | |
| 626 | sensoring.Position = clone.Torso.Position | |
| 627 | local welder = Instance.new("Weld", sensoring)
| |
| 628 | welder.Part0 = clone.Torso | |
| 629 | welder.Part1 = sensoring | |
| 630 | welder.C0 = welder.C0 * CFrame.new(0,0,1.05) | |
| 631 | sensoring.Transparency = 1 | |
| 632 | ----------------- | |
| 633 | sensoring1 = Instance.new("Part", clone.Torso)
| |
| 634 | sensoring1.Size = Vector3.new(1.2,1.1,0.8) | |
| 635 | sensoring1.CanCollide = false | |
| 636 | sensoring1.Position = clone.Torso.Position | |
| 637 | local welder1 = Instance.new("Weld", sensoring)
| |
| 638 | welder1.Part0 = clone.Torso | |
| 639 | welder1.Part1 = sensoring1 | |
| 640 | welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05) | |
| 641 | sensoring1.Transparency = 1 | |
| 642 | end | |
| 643 | clone.Name = humanoid.Parent.Name.."" | |
| 644 | ded:Play() | |
| 645 | vel:destroy() | |
| 646 | wait(0.5) | |
| 647 | local function touch() | |
| 648 | if not using then | |
| 649 | using = true | |
| 650 | local Math = math.random(1,4) | |
| 651 | if Math == 1 then | |
| 652 | hit:Play() | |
| 653 | end | |
| 654 | if Math == 2 then | |
| 655 | hit1:Play() | |
| 656 | end | |
| 657 | if Math == 3 then | |
| 658 | hit2:Play() | |
| 659 | end | |
| 660 | if Math == 4 then | |
| 661 | hit3:Play() | |
| 662 | end | |
| 663 | wait(0.1) | |
| 664 | using = false | |
| 665 | end | |
| 666 | end | |
| 667 | sensoring.Touched:connect(touch) | |
| 668 | sensoring1.Touched:connect(touch) | |
| 669 | while true do | |
| 670 | if clone:findFirstChild("Head") then
| |
| 671 | clone.Head.CanCollide = false | |
| 672 | end | |
| 673 | game:GetService("RunService").Stepped:wait()
| |
| 674 | end | |
| 675 | end | |
| 676 | end | |
| 677 | end | |
| 678 | end | |
| 679 | Part0.Touched:connect(hittie) | |
| 680 | function ragdoll() | |
| 681 | game.Players.LocalPlayer.Character.Archivable = true | |
| 682 | clone = game.Players.LocalPlayer.Character:Clone() | |
| 683 | clone.Parent = workspace | |
| 684 | for i,v in pairs(clone:GetChildren()) do | |
| 685 | if v.ClassName == "Script" or v.ClassName == "LocalScript" then | |
| 686 | v:Remove() | |
| 687 | end | |
| 688 | for i,p in pairs(v:GetChildren()) do | |
| 689 | if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then | |
| 690 | p:Remove() | |
| 691 | end | |
| 692 | end | |
| 693 | end | |
| 694 | for i,t in pairs(game.Players.LocalPlayer.Character:GetChildren()) do | |
| 695 | if t.ClassName == "Accessory" or t.ClassName == "ForceField" then | |
| 696 | t:Remove() | |
| 697 | end | |
| 698 | end | |
| 699 | vel = Instance.new("BodyVelocity", clone.Torso)
| |
| 700 | vel.Velocity = clone.Torso.CFrame.lookVector * -5 | |
| 701 | vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
| 702 | clone.Head.face.Texture = "http://www.roblox.com/asset/?id=161061608" | |
| 703 | using = false | |
| 704 | hit = Instance.new("Sound", clone.Torso)
| |
| 705 | hit.SoundId = "rbxassetid://260430060" | |
| 706 | hit.Volume = 0 | |
| 707 | hit1 = Instance.new("Sound", clone.Torso)
| |
| 708 | hit1.SoundId = "rbxassetid://138087186" | |
| 709 | hit1.Volume = 0 | |
| 710 | hit2 = Instance.new("Sound", clone.Torso)
| |
| 711 | hit2.SoundId = "rbxassetid://131237241" | |
| 712 | hit2.Volume = 0 | |
| 713 | hit3 = Instance.new("Sound", clone.Torso)
| |
| 714 | hit3.SoundId = "rbxassetid://278062209" | |
| 715 | hit3.Volume = 0 | |
| 716 | hit3.TimePosition = 0.33 | |
| 717 | ded = Instance.new("Sound", clone.Torso)
| |
| 718 | ded.SoundId = "rbxassetid://337800380" | |
| 719 | ded.Volume = 0 | |
| 720 | local leftarm = clone:findFirstChild("Left Arm")
| |
| 721 | local rightrm = clone:findFirstChild("Right Arm")
| |
| 722 | local leftleg = clone:findFirstChild("Left Leg")
| |
| 723 | local rightleg = clone:findFirstChild("Right Leg")
| |
| 724 | local head = clone:findFirstChild("Head")
| |
| 725 | for i, g in pairs(game.Players.LocalPlayer.Character:GetChildren()) do | |
| 726 | if g.ClassName == "Part" then | |
| 727 | g:destroy() | |
| 728 | end | |
| 729 | end | |
| 730 | for i, h in pairs(game.Players.LocalPlayer.Character:GetChildren()) do | |
| 731 | if h.ClassName == "Accesory" then | |
| 732 | h:destroy() | |
| 733 | end | |
| 734 | end | |
| 735 | game.Workspace.CurrentCamera.CameraSubject = head | |
| 736 | if head then | |
| 737 | local attachment = Instance.new("Attachment", clone.Head)
| |
| 738 | attachment.Position = Vector3.new(0, -0.5, 0) | |
| 739 | attachment.Name = "lol" | |
| 740 | attachment.Visible = false | |
| 741 | clone.Torso.NeckAttachment.Visible = false | |
| 742 | clone.Torso.NeckAttachment.Position = clone.Torso.NeckAttachment.Position + Vector3.new(0,0,0) | |
| 743 | local ball = Instance.new("BallSocketConstraint", clone)
| |
| 744 | ball.Attachment0 = clone.Torso.NeckAttachment | |
| 745 | ball.Attachment1 = attachment | |
| 746 | ball.LimitsEnabled = true | |
| 747 | ball.TwistLimitsEnabled = true | |
| 748 | ball.UpperAngle = 90 | |
| 749 | ball.Restitution = 0.5 | |
| 750 | ball.TwistUpperAngle = 90 | |
| 751 | ball.TwistLowerAngle = -90 | |
| 752 | local collidepartofleftleg = Instance.new("Part", clone.Torso)
| |
| 753 | collidepartofleftleg.Name = "Bone" | |
| 754 | collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7) | |
| 755 | collidepartofleftleg.Transparency = 1 | |
| 756 | collidepartofleftleg:BreakJoints() | |
| 757 | local weeld = Instance.new("Weld", collidepartofleftleg)
| |
| 758 | weeld.Part0 = collidepartofleftleg | |
| 759 | weeld.Part1 = clone["Head"] | |
| 760 | end | |
| 761 | if leftleg ~= nil then | |
| 762 | local glue = Instance.new("Glue", clone.Torso)
| |
| 763 | glue.Part0 = clone.Torso | |
| 764 | glue.Part1 = leftleg | |
| 765 | glue.Name = "Left leg" | |
| 766 | local collider = Instance.new("Part", leftleg)
| |
| 767 | collider.Position = Vector3.new(0,999,0) | |
| 768 | collider.Size = Vector3.new(1.5, 1, 1) | |
| 769 | collider.Shape = "Cylinder" | |
| 770 | local weld = Instance.new("Weld", collider)
| |
| 771 | weld.Part0 = leftleg | |
| 772 | weld.Part1 = collider | |
| 773 | weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 774 | collider.TopSurface = "Smooth" | |
| 775 | collider.BottomSurface = "Smooth" | |
| 776 | collider.formFactor = "Symmetric" | |
| 777 | glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 778 | glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
| 779 | collider.Transparency = 1 | |
| 780 | end | |
| 781 | ------------ | |
| 782 | if rightleg ~= nil then | |
| 783 | local glue1 = Instance.new("Glue", clone.Torso)
| |
| 784 | glue1.Part0 = clone.Torso | |
| 785 | glue1.Part1 = rightleg | |
| 786 | glue1.Name = "Right leg" | |
| 787 | local collider1 = Instance.new("Part", rightleg)
| |
| 788 | collider1.Position = Vector3.new(0,999,0) | |
| 789 | collider1.Size = Vector3.new(1.5, 1, 1) | |
| 790 | collider1.Shape = "Cylinder" | |
| 791 | local weld1 = Instance.new("Weld", collider1)
| |
| 792 | weld1.Part0 = rightleg | |
| 793 | weld1.Part1 = collider1 | |
| 794 | weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 795 | collider1.TopSurface = "Smooth" | |
| 796 | collider1.BottomSurface = "Smooth" | |
| 797 | collider1.formFactor = "Symmetric" | |
| 798 | glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 799 | glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
| 800 | collider1.Transparency = 1 | |
| 801 | end | |
| 802 | ------------ | |
| 803 | if rightrm ~= nil then | |
| 804 | local glue11 = Instance.new("Glue", clone.Torso)
| |
| 805 | glue11.Part0 = clone.Torso | |
| 806 | glue11.Part1 = rightrm | |
| 807 | glue11.Name = "Right shoulder" | |
| 808 | local collider11 = Instance.new("Part", rightrm)
| |
| 809 | collider11.Position = Vector3.new(0,9999,0) | |
| 810 | collider11.Size = Vector3.new(1.5,1,1) | |
| 811 | collider11.Shape = "Cylinder" | |
| 812 | local weld11 = Instance.new("Weld", collider11)
| |
| 813 | weld11.Part0 = rightrm | |
| 814 | weld11.Part1 = collider11 | |
| 815 | weld11.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 816 | collider11.TopSurface = "Smooth" | |
| 817 | collider11.BottomSurface = "Smooth" | |
| 818 | collider11.formFactor = "Symmetric" | |
| 819 | glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
| 820 | glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) | |
| 821 | collider11.Transparency = 1 | |
| 822 | end | |
| 823 | ------------ | |
| 824 | if leftarm ~= nil then | |
| 825 | local glue111 = Instance.new("Glue", clone.Torso)
| |
| 826 | glue111.Part0 = clone.Torso | |
| 827 | glue111.Part1 = leftarm | |
| 828 | glue111.Name = "Left shoulder" | |
| 829 | local collider111 = Instance.new("Part", leftarm)
| |
| 830 | collider111.Position = Vector3.new(0,9999,0) | |
| 831 | collider111.Size = Vector3.new(1.5,1,1) | |
| 832 | collider111.Shape = "Cylinder" | |
| 833 | local weld111 = Instance.new("Weld", collider111)
| |
| 834 | weld111.Part0 = leftarm | |
| 835 | weld111.Part1 = collider111 | |
| 836 | weld111.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) | |
| 837 | collider111.TopSurface = "Smooth" | |
| 838 | collider111.BottomSurface = "Smooth" | |
| 839 | collider111.formFactor = "Symmetric" | |
| 840 | glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
| 841 | glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) | |
| 842 | collider111.Transparency = 1 | |
| 843 | ---------------- | |
| 844 | sensoring = Instance.new("Part", clone.Torso)
| |
| 845 | sensoring.Size = Vector3.new(1.2,1.1,0.8) | |
| 846 | sensoring.CanCollide = false | |
| 847 | sensoring.Position = clone.Torso.Position | |
| 848 | local welder = Instance.new("Weld", sensoring)
| |
| 849 | welder.Part0 = clone.Torso | |
| 850 | welder.Part1 = sensoring | |
| 851 | welder.C0 = welder.C0 * CFrame.new(0,0,1.05) | |
| 852 | sensoring.Transparency = 1 | |
| 853 | ----------------- | |
| 854 | sensoring1 = Instance.new("Part", clone.Torso)
| |
| 855 | sensoring1.Size = Vector3.new(1.2,1.1,0.8) | |
| 856 | sensoring1.CanCollide = false | |
| 857 | sensoring1.Position = clone.Torso.Position | |
| 858 | local welder1 = Instance.new("Weld", sensoring)
| |
| 859 | welder1.Part0 = clone.Torso | |
| 860 | welder1.Part1 = sensoring1 | |
| 861 | welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05) | |
| 862 | sensoring1.Transparency = 1 | |
| 863 | end | |
| 864 | clone.Name = game.Players.LocalPlayer.Character.Name.." (DEAD)" | |
| 865 | ded:Play() | |
| 866 | vel:destroy() | |
| 867 | wait(0.2) | |
| 868 | game.Debris:AddItem(clone,60) | |
| 869 | local function touch() | |
| 870 | if not using then | |
| 871 | using = true | |
| 872 | local Math = math.random(1,4) | |
| 873 | if Math == 1 then | |
| 874 | hit:Play() | |
| 875 | end | |
| 876 | if Math == 2 then | |
| 877 | hit1:Play() | |
| 878 | end | |
| 879 | if Math == 3 then | |
| 880 | hit2:Play() | |
| 881 | end | |
| 882 | if Math == 4 then | |
| 883 | hit3:Play() | |
| 884 | end | |
| 885 | wait(0.1) | |
| 886 | using = false | |
| 887 | end | |
| 888 | end | |
| 889 | sensoring.Touched:connect(touch) | |
| 890 | sensoring1.Touched:connect(touch) | |
| 891 | while true do | |
| 892 | clone.Head.CanCollide = false | |
| 893 | game:GetService("RunService").Stepped:wait()
| |
| 894 | end | |
| 895 | end | |
| 896 | ||
| 897 | game.Players.LocalPlayer.Character.Humanoid.Died:connect(ragdoll) | |
| 898 | ||
| 899 | --di ent | |
| 900 | while true do | |
| 901 | if cananimate then | |
| 902 | if game.Players.LocalPlayer.Character.Torso.Velocity.x < -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.x > 0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z < -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z > 0.5 and cananimate then | |
| 903 | for i = 0.1,0.3 , 0.008 do | |
| 904 | if cananimate and game.Players.LocalPlayer.Character.Torso.Velocity.x < -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.x > 0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z < -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z > 0.5 and cananimate then | |
| 905 | lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.53402293, 0.0594797134, 0.144087285, 0.997264206, 0.0707819909, 0.0213012099, -0.0739177391, 0.9549582, 0.287386209, 2.98023224e-08, -0.28817457, 0.957577825),i) | |
| 906 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.54035091, 0.0769848824, -0.170524538, 0.99592495, -0.0847774297, 0.0307573378, 0.090184398, 0.936214805, -0.339659303, 0, 0.341049016, 0.940045416),i) | |
| 907 | game:GetService("RunService").Stepped:wait()
| |
| 908 | end | |
| 909 | end | |
| 910 | for i = 0.1,0.3 , 0.008 do | |
| 911 | if cananimate and game.Players.LocalPlayer.Character.Torso.Velocity.x < -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.x > 0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z < -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z > 0.5 and cananimate then | |
| 912 | lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.53173375, 0.0903658867, -0.222393572, 0.997264206, 0.0662034005, -0.0328776538, -0.0739177391, 0.893185973, -0.443570435, 2.98023224e-08, 0.444787204, 0.895636141),i) | |
| 913 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.54079688, 0.0720610619, 0.156226337, 0.99592495, -0.085669145, -0.0281783342, 0.090184398, 0.946062148, 0.311179608, 0, -0.312452823, 0.949932992),i) | |
| 914 | game:GetService("RunService").Stepped:wait()
| |
| 915 | end | |
| 916 | end | |
| 917 | elseif game.Players.LocalPlayer.Character.Torso.Velocity.x > -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.x < 0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z > -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z < 0.5 then | |
| 918 | for i = 0,1 , 0.1 do | |
| 919 | if cananimate and game.Players.LocalPlayer.Character.Torso.Velocity.x > -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.x < 0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z > -0.5 or game.Players.LocalPlayer.Character.Torso.Velocity.z < 0.5 and cananimate then | |
| 920 | weld.C0 = weld.C0:lerp(CFrame.new(0.0769970417, -1.17027426, -1.17937994, 0, 0, 1, -0.999999881, 0, 0, 0, -1, 0),i) | |
| 921 | headweld.C0 = headweld.C0:lerp(CFrame.new(0, 1.5, 0, 0.962374032, 0, 0.271727562, 0, 1, 0, -0.271727562, 0, 0.962374032),i) | |
| 922 | humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0, 0, 0, 0.955355227, 0, -0.295459419, 0, 1, 0, 0.295459419, 0, 0.955355227),i) | |
| 923 | lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.53559077, 0.0383267403, 0, 0.997264206, 0.0739177391, 0, -0.0739177391, 0.997264266, 0, 2.98023224e-08, 1.86264515e-09, 0.999999881),i) | |
| 924 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.54305458, 0.047129631, 2.98023224e-08, 0.99592495, -0.0901843905, 0, 0.090184398, 0.995925009, 0, 0, 0, 0.999999881),i) | |
| 925 | game:GetService("RunService").RenderStepped:wait()
| |
| 926 | end | |
| 927 | end | |
| 928 | end | |
| 929 | end | |
| 930 | wait() | |
| 931 | end |