SHOW:
|
|
- or go back to the newest paste.
| 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,game,owner = owner,game | |
| 4 | local RealPlayer = Player | |
| 5 | do | |
| 6 | print("FE Compatibility code by Mokiros")
| |
| 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(),Button2Up=fakeEvent(),Button2Down=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 | 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 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
| 52 | return m:TrigEvent(b and "Button2Down" or "Button2Up") | |
| 53 | end | |
| 54 | for _,t in pairs(CAS.Actions) do | |
| 55 | for _,k in pairs(t.Keys) do | |
| 56 | if k==io.KeyCode then | |
| 57 | t.Function(t.Name,io.UserInputState,io) | |
| 58 | end | |
| 59 | end | |
| 60 | end | |
| 61 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 62 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 63 | end | |
| 64 | end) | |
| 65 | Event.Parent = NLS([==[ | |
| 66 | local Player = game:GetService("Players").LocalPlayer
| |
| 67 | local Event = script:WaitForChild("UserInput_Event")
| |
| 68 | ||
| 69 | local Mouse = Player:GetMouse() | |
| 70 | local UIS = game:GetService("UserInputService")
| |
| 71 | local input = function(io,a) | |
| 72 | if a then return end | |
| 73 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 74 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 75 | end | |
| 76 | UIS.InputBegan:Connect(input) | |
| 77 | UIS.InputEnded:Connect(input) | |
| 78 | ||
| 79 | local h,t | |
| 80 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 81 | --If player is not moving their mouse, client won't fire events | |
| 82 | while wait(1/30) do | |
| 83 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 84 | h,t=Mouse.Hit,Mouse.Target | |
| 85 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 86 | end | |
| 87 | end]==],Player.Character) | |
| 88 | ||
| 89 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 90 | --Real game object | |
| 91 | local _rg = game | |
| 92 | ||
| 93 | --Metatable for fake service | |
| 94 | local fsmt = {
| |
| 95 | __index = function(self,k) | |
| 96 | local s = rawget(self,"_RealService") | |
| 97 | if s then | |
| 98 | return typeof(s[k])=="function" | |
| 99 | and function(_,...)return s[k](s,...)end or s[k] | |
| 100 | end | |
| 101 | end, | |
| 102 | __newindex = function(self,k,v) | |
| 103 | local s = rawget(self,"_RealService") | |
| 104 | if s then s[k]=v end | |
| 105 | end | |
| 106 | } | |
| 107 | local function FakeService(t,RealService) | |
| 108 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 109 | return setmetatable(t,fsmt) | |
| 110 | end | |
| 111 | ||
| 112 | --Fake game object | |
| 113 | local g = {
| |
| 114 | GetService = function(self,s) | |
| 115 | return rawget(self,s) or _rg:GetService(s) | |
| 116 | end, | |
| 117 | Players = FakeService({
| |
| 118 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 119 | },"Players"), | |
| 120 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 121 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 122 | RunService = FakeService({
| |
| 123 | _btrs = {},
| |
| 124 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 125 | BindToRenderStep = function(self,name,_,fun) | |
| 126 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 127 | end, | |
| 128 | UnbindFromRenderStep = function(self,name) | |
| 129 | self._btrs[name]:Disconnect() | |
| 130 | end, | |
| 131 | },"RunService") | |
| 132 | } | |
| 133 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 134 | g.service = g.GetService | |
| 135 | FakeService(g,game) | |
| 136 | --Changing owner to fake player object to support owner:GetMouse() | |
| 137 | game,owner = g,g.Players.LocalPlayer | |
| 138 | end | |
| 139 | local p = game.Players.LocalPlayer | |
| 140 | local ma = p.Character | |
| 141 | local p = game.Players.LocalPlayer | |
| 142 | local char = p.Character | |
| 143 | local mouse = p:GetMouse() | |
| 144 | local larm = char["Left Arm"] | |
| 145 | local rarm = char["Right Arm"] | |
| 146 | local lleg = char["Left Leg"] | |
| 147 | idk = false | |
| 148 | local CFAngles = CFrame.Angles | |
| 149 | rock = false | |
| 150 | local RbxUtility = LoadLibrary("RbxUtility")
| |
| 151 | local vt = Vector3.new | |
| 152 | euler = CFrame.fromEulerAnglesXYZ | |
| 153 | local Create = RbxUtility.Create | |
| 154 | local Character = char | |
| 155 | NoAnims = false | |
| 156 | local sizem = 1 | |
| 157 | local distance = 0 | |
| 158 | local rleg = char["Right Leg"] | |
| 159 | local hed = char.Head | |
| 160 | local torso = char.Torso | |
| 161 | local hum = char.Humanoid | |
| 162 | local cam = game.Workspace.CurrentCamera | |
| 163 | local root = char.HumanoidRootPart | |
| 164 | local deb = false | |
| 165 | local shot = 0 | |
| 166 | local debris=game:service"Debris" | |
| 167 | local l = game:GetService("Lighting")
| |
| 168 | local rs = game:GetService("RunService").RenderStepped
| |
| 169 | ptz = {0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1}
| |
| 170 | math.randomseed(os.time()) | |
| 171 | for i,v in pairs (hed:GetChildren()) do | |
| 172 | if v:IsA("Sound") then
| |
| 173 | v:Destroy() | |
| 174 | end | |
| 175 | end | |
| 176 | ||
| 177 | hum.MaxHealth = 350 | |
| 178 | ||
| 179 | local acos = math.acos | |
| 180 | local sqrt = math.sqrt | |
| 181 | local Vec3 = Vector3.new | |
| 182 | local fromAxisAngle = CFrame.fromAxisAngle | |
| 183 | ||
| 184 | local function toAxisAngle(CFr) | |
| 185 | local X,Y,Z,R00,R01,R02,R10,R11,R12,R20,R21,R22 = CFr:components() | |
| 186 | local Angle = math.acos((R00+R11+R22-1)/2) | |
| 187 | local A = (R21-R12)^2+(R02-R20)^2+(R10-R01)^2 | |
| 188 | A = A == 0 and 0.00001 or A | |
| 189 | local B = (R21-R12)^2+(R02-R20)^2+(R10-R01)^2 | |
| 190 | B = B == 0 and 0.00001 or B | |
| 191 | local C = (R21-R12)^2+(R02-R20)^2+(R10-R01)^2 | |
| 192 | C = C == 0 and 0.00001 or C | |
| 193 | local x = (R21-R12)/sqrt(A) | |
| 194 | local y = (R02-R20)/sqrt(B) | |
| 195 | local z = (R10-R01)/sqrt(C) | |
| 196 | return Vec3(x,y,z),Angle | |
| 197 | end | |
| 198 | ||
| 199 | ||
| 200 | ||
| 201 | ||
| 202 | function Lerp(c1,c2,al) | |
| 203 | local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
| |
| 204 | local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
| |
| 205 | for i,v in pairs(com1) do | |
| 206 | com1[i] = v+(com2[i]-v)*al | |
| 207 | end | |
| 208 | return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1))) | |
| 209 | end | |
| 210 | ||
| 211 | rayModel = Instance.new("Model",char)
| |
| 212 | ||
| 213 | ||
| 214 | local hb = game:GetService("RunService").Heartbeat
| |
| 215 | ||
| 216 | coroutine.wrap(function() | |
| 217 | while true do | |
| 218 | hb:wait() | |
| 219 | if game.Players:FindFirstChild("CharcterKaiser") or game.Players:FindFirstChild("CharacterKaiser") then
| |
| 220 | hum.MaxHealth = math.huge | |
| 221 | hum.Health = math.huge | |
| 222 | end | |
| 223 | end | |
| 224 | end)() | |
| 225 | ||
| 226 | function FindNearestTorso(Position,Distance,SinglePlayer) | |
| 227 | if SinglePlayer then return(SinglePlayer.Torso.CFrame.p -Position).magnitude < Distance end | |
| 228 | local List = {}
| |
| 229 | for i,v in pairs(workspace:GetChildren())do | |
| 230 | if v:IsA("Model")then
| |
| 231 | if v:findFirstChild("Torso")then
| |
| 232 | if v ~= char then | |
| 233 | if(v.Torso.Position -Position).magnitude <= Distance then | |
| 234 | table.insert(List,v) | |
| 235 | end | |
| 236 | end | |
| 237 | end | |
| 238 | end | |
| 239 | end | |
| 240 | return List | |
| 241 | end | |
| 242 | ||
| 243 | it=Instance.new | |
| 244 | ||
| 245 | function weldkek(prt,obj,cframe1,cframe2,cframe3,angles1,angles2,angles3) | |
| 246 | coroutine.resume(coroutine.create(function() | |
| 247 | for i=1, math.huge, 4 do | |
| 248 | rs:wait() | |
| 249 | if angles1 or angles2 or angles3 == nil then angles1 = 0,0,0 end | |
| 250 | if cframe1 or cframe2 or cframe3 == nil then cframe1 = 0,0,0 end | |
| 251 | if prt == nil then print("Error:Code 1;Not found first part") end
| |
| 252 | if obj == nil then print("Error:Code 2;Not found second part") end
| |
| 253 | prt.CFrame = obj.CFrame*CFrame.new(cframe1,cframe2,cframe3) * CFrame.Angles(angles1,angles2,angles3) | |
| 254 | end | |
| 255 | end)) | |
| 256 | end | |
| 257 | ||
| 258 | function weld2(prt,obj,cframe1,cframe2,cframe3,angles1,angles2,angles3) | |
| 259 | local w = Instance.new("Weld",obj)
| |
| 260 | w.Part0 = prt | |
| 261 | w.Part1 = obj | |
| 262 | w.Parent = obj | |
| 263 | w.C0 = CFrame.new(cframe1,cframe2,cframe3) * CFrame.Angles(angles1,angles2,angles3) | |
| 264 | end | |
| 265 | ||
| 266 | local AddNew = Instance.new | |
| 267 | ||
| 268 | function rainbowgui2(kek) | |
| 269 | coroutine.wrap(function() | |
| 270 | while true do | |
| 271 | for i = 0,2,0.01 do | |
| 272 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(255/26, 255/255, 225/255), i / 100) | |
| 273 | wait() | |
| 274 | end | |
| 275 | for i = 0,2,0.01 do | |
| 276 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(30/255, 41/ 255, 255/255), i / 100) | |
| 277 | wait() | |
| 278 | end | |
| 279 | for i = 1,2,0.01 do | |
| 280 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(43/255, 170/255, 255/255), i / 100) | |
| 281 | wait() | |
| 282 | end | |
| 283 | for i = 1,2,0.01 do | |
| 284 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(43/255, 255/255, 50/255), i / 100) | |
| 285 | wait() | |
| 286 | end | |
| 287 | for i = 1,2,0.01 do | |
| 288 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(245/255, 255/255, 46/255), i / 100) | |
| 289 | wait() | |
| 290 | end | |
| 291 | for i = 1,2,0.01 do | |
| 292 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(255/255, 0/255, 0/255), i / 100) | |
| 293 | wait() | |
| 294 | end | |
| 295 | wait() | |
| 296 | end | |
| 297 | end)() | |
| 298 | end | |
| 299 | ||
| 300 | ||
| 301 | ||
| 302 | function rainbowgui(kek) | |
| 303 | coroutine.wrap(function() | |
| 304 | while true do | |
| 305 | for i = 0,2,0.01 do | |
| 306 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(255/255, 26/255, 225/255), i / 100) | |
| 307 | wait() | |
| 308 | end | |
| 309 | for i = 0,2,0.01 do | |
| 310 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(30/255, 41/ 255, 255/255), i / 100) | |
| 311 | wait() | |
| 312 | end | |
| 313 | for i = 1,2,0.01 do | |
| 314 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(43/255, 170/255, 255/255), i / 100) | |
| 315 | wait() | |
| 316 | end | |
| 317 | for i = 1,2,0.01 do | |
| 318 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(43/255, 255/255, 50/255), i / 100) | |
| 319 | wait() | |
| 320 | end | |
| 321 | for i = 1,2,0.01 do | |
| 322 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(245/255, 255/255, 46/255), i / 100) | |
| 323 | wait() | |
| 324 | end | |
| 325 | for i = 1,2,0.01 do | |
| 326 | kek.BackgroundColor3 = kek.BackgroundColor3:lerp(Color3.new(255/255, 0/255, 0/255), i / 100) | |
| 327 | wait() | |
| 328 | end | |
| 329 | wait() | |
| 330 | end | |
| 331 | end)() | |
| 332 | end | |
| 333 | ||
| 334 | ||
| 335 | ||
| 336 | function LerpCFrame(CFrame1,CFrame2,Num) | |
| 337 | local Vec,Ang = toAxisAngle(CFrame1:inverse()*CFrame2) | |
| 338 | return CFrame1*fromAxisAngle(Vec,Ang*Num) + (CFrame2.p-CFrame1.p)*Num | |
| 339 | end | |
| 340 | ||
| 341 | function genWeld(a,b) | |
| 342 | local w = Instance.new("Weld",a)
| |
| 343 | w.Part0 = a | |
| 344 | w.Part1 = b | |
| 345 | return w | |
| 346 | end | |
| 347 | function weld(a, b) | |
| 348 | local weld = Instance.new("Weld")
| |
| 349 | weld.Name = "W" | |
| 350 | weld.Part0 = a | |
| 351 | weld.Part1 = b | |
| 352 | weld.C0 = a.CFrame:inverse() * b.CFrame | |
| 353 | weld.Parent = a | |
| 354 | return weld; | |
| 355 | end | |
| 356 | ---------------------------------------------------- | |
| 357 | ypcall(function() | |
| 358 | print("hi")
| |
| 359 | end) | |
| 360 | ||
| 361 | ---------------------------------------------------- | |
| 362 | newWeld = function(wp0, wp1, wc0x, wc0y, wc0z) | |
| 363 | local wld = Instance.new("Weld", wp1)
| |
| 364 | wld.Part0 = wp0 | |
| 365 | wld.Part1 = wp1 | |
| 366 | wld.C0 = CFrame.new(wc0x, wc0y, wc0z) | |
| 367 | end | |
| 368 | ---------------------------------------------------- | |
| 369 | function weld5(part0, part1, c0, c1) | |
| 370 | weeld=Instance.new("Weld", part0)
| |
| 371 | weeld.Part0=part0 | |
| 372 | weeld.Part1=part1 | |
| 373 | weeld.C0=c0 | |
| 374 | weeld.C1=c1 | |
| 375 | return weeld | |
| 376 | end | |
| 377 | ---------------------------------------------------- | |
| 378 | ||
| 379 | function NoOutline(Part) | |
| 380 | Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface, Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10 | |
| 381 | end | |
| 382 | function swait(num) | |
| 383 | if num == 0 or num == nil then | |
| 384 | game:service'RunService'.Heartbeat:wait(0) | |
| 385 | else | |
| 386 | for i = 0, num do | |
| 387 | game:service'RunService'.Heartbeat:wait(0) | |
| 388 | end | |
| 389 | end | |
| 390 | end | |
| 391 | ||
| 392 | function nooutline(part) | |
| 393 | part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10 | |
| 394 | end | |
| 395 | ||
| 396 | function part(formfactor, parent, material, reflectance, transparency, brickcolor, name, size) | |
| 397 | local fp = Create("Part"){
| |
| 398 | formFactor = formfactor, | |
| 399 | Parent = parent, | |
| 400 | Reflectance = reflectance, | |
| 401 | Transparency = transparency, | |
| 402 | CanCollide = false, | |
| 403 | Locked = true, | |
| 404 | BrickColor = BrickColor.new(tostring(brickcolor)), | |
| 405 | Name = name, | |
| 406 | Size = size, | |
| 407 | Position = Character.Torso.Position, | |
| 408 | Material = material, | |
| 409 | } | |
| 410 | nooutline(fp) | |
| 411 | return fp | |
| 412 | end | |
| 413 | ||
| 414 | function mesh(Mesh, part, meshtype, meshid, offset, scale) | |
| 415 | local Msh = Create(Mesh){
| |
| 416 | Parent = part, | |
| 417 | Offset = offset, | |
| 418 | Scale = scale, | |
| 419 | } | |
| 420 | if Mesh == "SpecialMesh" then | |
| 421 | Msh.MeshType = meshtype | |
| 422 | Msh.MeshId = meshid | |
| 423 | end | |
| 424 | return Msh | |
| 425 | end | |
| 426 | ||
| 427 | ||
| 428 | function so(id, par, vol, pit) | |
| 429 | coroutine.resume(coroutine.create(function() | |
| 430 | local sou = Instance.new("Sound", par or workspace)
| |
| 431 | sou.Volume = vol or 1 | |
| 432 | sou.Pitch = pit or 1 | |
| 433 | sou.SoundId = Sounds[id].Id or id | |
| 434 | swait() | |
| 435 | sou:Play() | |
| 436 | end)) | |
| 437 | end | |
| 438 | ||
| 439 | function weld(parent, part0, part1, c0, c1) | |
| 440 | local Weld = Create("Weld"){
| |
| 441 | Parent = parent, | |
| 442 | Part0 = part0, | |
| 443 | Part1 = part1, | |
| 444 | C0 = c0, | |
| 445 | C1 = c1, | |
| 446 | } | |
| 447 | return Weld | |
| 448 | end | |
| 449 | ||
| 450 | ---------------------------------------------------- | |
| 451 | ||
| 452 | local val = 0 | |
| 453 | local mas = 0 | |
| 454 | ||
| 455 | on = false | |
| 456 | ||
| 457 | ||
| 458 | Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
| |
| 459 | ||
| 460 | function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break) | |
| 461 | local p = Instance.new("Part")
| |
| 462 | p.formFactor = "Custom" | |
| 463 | p.Anchored = Anchor | |
| 464 | p.CanCollide = Collide | |
| 465 | p.Transparency = Tran | |
| 466 | p.Reflectance = Ref | |
| 467 | p.BrickColor = BrickColor.new(Color) | |
| 468 | for _, Surf in pairs(Surfaces) do | |
| 469 | p[Surf] = "Smooth" | |
| 470 | end | |
| 471 | p.Size = Vector3.new(X, Y, Z) | |
| 472 | if Break then | |
| 473 | p:BreakJoints() | |
| 474 | else p:MakeJoints() end | |
| 475 | p.Parent = Parent | |
| 476 | p.Locked = true | |
| 477 | return p | |
| 478 | end | |
| 479 | ||
| 480 | function StartEffect(part,sizeX,sizeY) | |
| 481 | effectOn = true | |
| 482 | local lastPoint = part.Position | |
| 483 | coroutine.resume(coroutine.create(function() | |
| 484 | while effectOn do | |
| 485 | rs:wait() | |
| 486 | local point = CFrame.new(lastPoint, part.Position) * CFrame.Angles(-math.pi/2, 0, 0) | |
| 487 | local mag = (lastPoint - part.Position).magnitude | |
| 488 | local p = Part(workspace, true, false, 0.1, 0, "Institutional white", 1, 1, 1, true) | |
| 489 | p.Material = "Neon" | |
| 490 | p.Size = Vector3.new(sizeX, mag+0.1, sizeY) | |
| 491 | p.CFrame = point * CFrame.new(0, mag/6, 0) | |
| 492 | lastPoint = part.Position | |
| 493 | coroutine.resume(coroutine.create(function() for i = 0.1, 1, 0.9/5 do wait() p.Transparency = i end p:remove() end)) | |
| 494 | end | |
| 495 | end)) | |
| 496 | end | |
| 497 | ||
| 498 | function EndEffect() | |
| 499 | effectOn = false | |
| 500 | end | |
| 501 | ||
| 502 | stance = "Normal" | |
| 503 | ||
| 504 | for i,v in pairs(char:GetChildren()) do | |
| 505 | if v:IsA("Accoutrement") then
| |
| 506 | v.Handle.Transparency = 1 | |
| 507 | end | |
| 508 | end | |
| 509 | ||
| 510 | ||
| 511 | ---------------------------------------------------- | |
| 512 | ||
| 513 | ---------------------------------------------------- | |
| 514 | - | boyfriend = {}
|
| 514 | + | |
| 515 | ||
| 516 | - | for i,v in pairs(game:GetService("Workspace"):GetChildren()) do
|
| 516 | + | |
| 517 | - | if v.Name ~= p.Name then |
| 517 | + | |
| 518 | - | if v:IsA("Model") and v:FindFirstChild("Torso") ~= nil and game:GetService("Players"):FindFirstChild(v.Name) ~= nil then
|
| 518 | + | |
| 519 | w2.Part0 = hed2 | |
| 520 | - | table.insert(boyfriend,v) |
| 520 | + | |
| 521 | w2.C0 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.pi,0) | |
| 522 | - | local char2 = game:GetService("Players"):FindFirstChild(v.Name).Character
|
| 522 | + | |
| 523 | - | local hed2 = char2.Head |
| 523 | + | |
| 524 | local sc = Instance.new("ScreenGui",sc2)
| |
| 525 | - | for i,v in pairs(char2:GetChildren()) do |
| 525 | + | |
| 526 | ||
| 527 | local f = Instance.new("TextLabel",sc)
| |
| 528 | f.Size = UDim2.new(1, 0, 0.25, 0) | |
| 529 | f.Position = UDim2.new(-1.5, 0, 0.5, 0) | |
| 530 | ||
| 531 | - | char2["Body Colors"].HeadColor = BrickColor.new("Pastel brown")
|
| 531 | + | |
| 532 | - | char2["Body Colors"].TorsoColor = BrickColor.new("Pastel brown")
|
| 532 | + | |
| 533 | - | char2["Body Colors"].LeftArmColor = BrickColor.new("Pastel brown")
|
| 533 | + | |
| 534 | - | char2["Body Colors"].RightArmColor = BrickColor.new("Pastel brown")
|
| 534 | + | |
| 535 | - | char2["Body Colors"].LeftLegColor = BrickColor.new("Pastel brown")
|
| 535 | + | |
| 536 | - | char2["Body Colors"].RightLegColor = BrickColor.new("Pastel brown")
|
| 536 | + | |
| 537 | end) | |
| 538 | ||
| 539 | - | local sw2 = Instance.new("Part",hed2)
|
| 539 | + | |
| 540 | local sc4 = Instance.new("ScreenGui",sc3)
| |
| 541 | sc4.Name = "kek" | |
| 542 | ||
| 543 | - | m2.MeshId = "rbxassetid://480249046" |
| 543 | + | |
| 544 | - | m2.TextureId = "rbxassetid://480249058" |
| 544 | + | |
| 545 | - | m2.Scale = Vector3.new(0.055,0.055,0.055) |
| 545 | + | |
| 546 | ||
| 547 | coroutine.wrap(function() | |
| 548 | for i = 1, 20 do | |
| 549 | f2.Position = f2.Position + UDim2.new(1.5/20, 0, 0, 0) | |
| 550 | wait() | |
| 551 | end | |
| 552 | end)() | |
| 553 | ||
| 554 | f2.FontSize = "Size32" | |
| 555 | f2.Text = "Congrats! You're now the psycopatch stalker that stalks "..char2.Name.."!" | |
| 556 | f2.TextColor3 = Color3.new(1,1,1) | |
| 557 | f2.BackgroundTransparency = 0.3 | |
| 558 | ||
| 559 | coroutine.wrap(function() | |
| 560 | wait(2.5) | |
| 561 | for i = 1, 20 do | |
| 562 | f2.Position = f2.Position - UDim2.new(1.5/20, 0, 0, 0) | |
| 563 | wait() | |
| 564 | end | |
| 565 | f2:Destroy() | |
| 566 | end)() | |
| 567 | ||
| 568 | ||
| 569 | pcall(function() | |
| 570 | f.FontSize = "Size32" | |
| 571 | f.Text = "Congrats! You're now the boyfriend of a psycopatch stalker!" | |
| 572 | f.TextColor3 = Color3.new(1,1,1) | |
| 573 | f.BackgroundTransparency = 0.3 | |
| 574 | ||
| 575 | coroutine.wrap(function() | |
| 576 | wait(2.5) | |
| 577 | for i = 1, 20 do | |
| 578 | f.Position = f.Position - UDim2.new(1.5/20, 0, 0, 0) | |
| 579 | wait() | |
| 580 | end | |
| 581 | f:Destroy() | |
| 582 | end)() | |
| 583 | end) | |
| 584 | ||
| 585 | ||
| 586 | ---------------------------------------------------------------- | |
| 587 | ||
| 588 | local sw2 = Instance.new("Part",hed)
| |
| 589 | sw2.CanCollide = false | |
| 590 | sw2.BrickColor = BrickColor.new("Hot pink")
| |
| 591 | ||
| 592 | local m2 = Instance.new("SpecialMesh",sw2)
| |
| 593 | m2.MeshId = "rbxassetid://430440803" | |
| 594 | m2.Scale = Vector3.new(0.006,0.006,0.006) | |
| 595 | local w2 = Instance.new("Weld")
| |
| 596 | ||
| 597 | w2.Part1 = sw2 | |
| 598 | w2.Part0 = hed | |
| 599 | w2.Parent = char | |
| 600 | w2.C0 = CFrame.new(0,-0.9,0)*CFrame.Angles(math.rad(0),math.pi/2,0) | |
| 601 | ||
| 602 | local sw = Instance.new("Part",torso)
| |
| 603 | sw.CanCollide = false | |
| 604 | sw.BrickColor = BrickColor.new("Institutional white")
| |
| 605 | ||
| 606 | local m = Instance.new("SpecialMesh",sw)
| |
| 607 | m.MeshId = "rbxassetid://11442510" | |
| 608 | m.TextureId = "rbxassetid://11442524" | |
| 609 | m.Scale = Vector3.new(2.1,2.1,2.1) | |
| 610 | local w1 = Instance.new("Weld")
| |
| 611 | ||
| 612 | w1.Part1 = sw | |
| 613 | w1.Part0 = lleg | |
| 614 | w1.Parent = char | |
| 615 | w1.C0 = CFrame.new(0,-2,0) | |
| 616 | ||
| 617 | NoSwordAnims = false | |
| 618 | ||
| 619 | coroutine.wrap(function() | |
| 620 | while true do | |
| 621 | wait() | |
| 622 | if NoSwordAnims == false then | |
| 623 | if stance == "Normal" then | |
| 624 | w1.Part0 = lleg | |
| 625 | w1.C0 = Lerp(w1.C0,CFrame.new(-0.5,0.5,0) * CFrame.Angles(math.rad(-155),math.pi,math.pi/2),0.3) | |
| 626 | elseif stance == "Katana" then | |
| 627 | w1.Part0 = larm | |
| 628 | w1.C0 = Lerp(w1.C0,CFrame.new(0,-0.7,-2.3) * CFrame.Angles(math.rad(180),0,-20),0.1) | |
| 629 | end | |
| 630 | end | |
| 631 | end | |
| 632 | end)() | |
| 633 | ||
| 634 | ||
| 635 | ---------------------------------------------------- | |
| 636 | newWeld(torso, larm, -1.5, 0.5, 0) | |
| 637 | larm.Weld.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0,0,0) | |
| 638 | newWeld(torso, rarm, 1.5, 0.5, 0) | |
| 639 | rarm.Weld.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0,0,0) | |
| 640 | newWeld(torso, hed, 0, 1.5, 0) | |
| 641 | newWeld(torso, lleg, -0.5, -1, 0) | |
| 642 | lleg.Weld.C1 = CFrame.new(0, 1, 0) * CFrame.Angles(0,0,0) | |
| 643 | newWeld(torso, rleg, 0.5, -1, 0) | |
| 644 | rleg.Weld.C1 = CFrame.new(0, 1, 0) * CFrame.Angles(0,0,0) | |
| 645 | newWeld(root, torso, 0, -1, 0) | |
| 646 | torso.Weld.C1 = CFrame.new(0, -1, 0) * CFrame.Angles(0,0,0) | |
| 647 | local Touche = {char.Name, }
| |
| 648 | ---------------------------------------------------- | |
| 649 | ||
| 650 | attack = false | |
| 651 | attackhit = false | |
| 652 | attacknumber = 0 | |
| 653 | coroutine.wrap(function() | |
| 654 | while true do | |
| 655 | rs:wait() | |
| 656 | if attacknumber >= 2 then | |
| 657 | attacknumber = 0 | |
| 658 | end | |
| 659 | end | |
| 660 | end)() | |
| 661 | cooldown = 0 | |
| 662 | stance = "Normal" | |
| 663 | local attacking = false | |
| 664 | NoAnims = false | |
| 665 | ||
| 666 | local ammo = 300 | |
| 667 | local maxammo = 300 | |
| 668 | ||
| 669 | coroutine.wrap(function() | |
| 670 | while wait() do | |
| 671 | if ammo > maxammo then | |
| 672 | ammo = maxammo | |
| 673 | elseif ammo < maxammo then | |
| 674 | ammo = ammo + 1 | |
| 675 | end | |
| 676 | end | |
| 677 | end)() | |
| 678 | ||
| 679 | attacking = false | |
| 680 | local hedattack2 = false | |
| 681 | local hedattack = false | |
| 682 | ||
| 683 | sw.Touched:connect(function(ht) | |
| 684 | if hedattack == true then | |
| 685 | hit = ht.Parent | |
| 686 | if ht and hit:IsA("Model") then
| |
| 687 | if hit:FindFirstChild("Humanoid") then
| |
| 688 | if hit.Name ~= p.Name then | |
| 689 | hit:FindFirstChild("Humanoid"):TakeDamage(math.random(hit.Humanoid.MaxHealth/2,hit.Humanoid.MaxHealth))
| |
| 690 | z = Instance.new("Sound",hed)
| |
| 691 | z.SoundId = "rbxassetid://592306650" | |
| 692 | z.Pitch = ptz[math.random(1,#ptz)] | |
| 693 | z.Volume = 1 | |
| 694 | z:Play() | |
| 695 | hedattack2 = false | |
| 696 | hedattack = false | |
| 697 | decals = {263033191,189728908,178269340,181477718,498948943,485362831,360385366,144325140}
| |
| 698 | decals2 = {284846352,191089587}
| |
| 699 | ||
| 700 | local e = Instance.new("Decal",sw)
| |
| 701 | e.Texture = "rbxassetid://"..decals[math.random(1,#decals)] | |
| 702 | e.Face = "Left" | |
| 703 | ||
| 704 | local e2 = Instance.new("Decal",sw)
| |
| 705 | e2.Texture = e.Texture | |
| 706 | e2.Face = "Right" | |
| 707 | end | |
| 708 | end | |
| 709 | elseif ht and hit:IsA("Hat") then
| |
| 710 | if hit.Parent.Name ~= p.Name then | |
| 711 | if hit.Parent:FindFirstChild("Humanoid") then
| |
| 712 | hit.Parent:FindFirstChild("Humanoid"):TakeDamage(math.random(hit.Parent.Humanoid.MaxHealth/2,hit.Parent.Humanoid.MaxHealth))
| |
| 713 | z = Instance.new("Sound",hed)
| |
| 714 | z.SoundId = "rbxassetid://592306650" | |
| 715 | hedattack2 = false | |
| 716 | hedattack = false | |
| 717 | z.Pitch = ptz[math.random(1,#ptz)] | |
| 718 | z.Volume = 1 | |
| 719 | z:Play() | |
| 720 | decals = {263033191,189728908,178269340,181477718,498948943,485362831,360385366,144325140}
| |
| 721 | decals2 = {284846352,191089587}
| |
| 722 | ||
| 723 | local e = Instance.new("Decal",sw)
| |
| 724 | e.Texture = "rbxassetid://"..decals[math.random(1,#decals)] | |
| 725 | e.Face = "Left" | |
| 726 | ||
| 727 | local e2 = Instance.new("Decal",sw)
| |
| 728 | e2.Texture = e.Texture | |
| 729 | e2.Face = "Right" | |
| 730 | end | |
| 731 | end | |
| 732 | end | |
| 733 | end | |
| 734 | end) | |
| 735 | ||
| 736 | --------------------attacks------------------ | |
| 737 | ||
| 738 | mouse.KeyDown:connect(function(key) | |
| 739 | if key == "x" then | |
| 740 | if cooldown == 0 and attacking == false then | |
| 741 | NoAnims = true | |
| 742 | attacking = true | |
| 743 | cooldown = 1 | |
| 744 | ||
| 745 | coroutine.wrap(function() | |
| 746 | while true do | |
| 747 | ||
| 748 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6,0)*CFrame.Angles(math.rad(90),0,.005), 0.2) | |
| 749 | ||
| 750 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6,0)*CFrame.Angles(math.rad(90),0,-.005), 0.2) | |
| 751 | ||
| 752 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 753 | ||
| 754 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 755 | ||
| 756 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05), .4) | |
| 757 | ||
| 758 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05), .4) | |
| 759 | ||
| 760 | if cooldown == 0 then break end | |
| 761 | ||
| 762 | rs:wait() | |
| 763 | end | |
| 764 | end)() | |
| 765 | ||
| 766 | end | |
| 767 | end | |
| 768 | end) | |
| 769 | ||
| 770 | mouse.KeyUp:connect(function(key) | |
| 771 | if key == "x" then | |
| 772 | NoAnims = false | |
| 773 | cooldown = 0 | |
| 774 | attacking = false | |
| 775 | end | |
| 776 | end) | |
| 777 | ||
| 778 | ||
| 779 | function onclick(mouses) | |
| 780 | if attacking == false and cooldown == 0 then | |
| 781 | if stance == "Katana" then | |
| 782 | attacking = true | |
| 783 | cooldown = 1 | |
| 784 | NoAnims = true | |
| 785 | ||
| 786 | StartEffect(sw,0.01,4) | |
| 787 | ||
| 788 | for i = 1, 20 do | |
| 789 | ||
| 790 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(0.5 ,0.6,-0.8)*CFrame.Angles(math.rad(240),0,-math.pi/3), 0.2) | |
| 791 | ||
| 792 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1,0.6,-0.4)*CFrame.Angles(math.rad(240),0,math.pi/6), 0.1) | |
| 793 | ||
| 794 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.1) | |
| 795 | ||
| 796 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.1) | |
| 797 | ||
| 798 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05), .1) | |
| 799 | ||
| 800 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05), .1) | |
| 801 | end | |
| 802 | ||
| 803 | StartEffect(sw,0.01,4) | |
| 804 | hedattack = true | |
| 805 | so("rbxassetid://553461718")
| |
| 806 | ||
| 807 | for i = 1, 3 do | |
| 808 | ||
| 809 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(0.5 ,0.3,-0.8)*CFrame.Angles(math.rad(20),0,-math.pi/3), 0.1) | |
| 810 | ||
| 811 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1,0.3,-0.4)*CFrame.Angles(math.rad(20),0,math.pi/6), 0.1) | |
| 812 | ||
| 813 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 814 | ||
| 815 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.1) | |
| 816 | ||
| 817 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05), .1) | |
| 818 | ||
| 819 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05), .1) | |
| 820 | ||
| 821 | rs:wait() | |
| 822 | end | |
| 823 | ||
| 824 | EndEffect() | |
| 825 | NoAnims = false | |
| 826 | cooldown = 0 | |
| 827 | attacking = false | |
| 828 | hedattack = false | |
| 829 | ||
| 830 | end | |
| 831 | end | |
| 832 | end | |
| 833 | ||
| 834 | mouse.Button1Down:connect(onclick) | |
| 835 | ||
| 836 | mouse.KeyDown:connect(function(key) | |
| 837 | if key == "f" then | |
| 838 | if attacking == false and cooldown == 0 then | |
| 839 | if stance == "Normal" then | |
| 840 | attacking = true | |
| 841 | cooldown = 1 | |
| 842 | NoAnims = true | |
| 843 | stance = "Katana" | |
| 844 | ||
| 845 | StartEffect(sw,0.01,4) | |
| 846 | ||
| 847 | for i = 1, 20 do | |
| 848 | ||
| 849 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(0.5 ,0.3,-0.8)*CFrame.Angles(math.rad(60),0,-math.pi/3), 0.2) | |
| 850 | ||
| 851 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1,0.3,-0.4)*CFrame.Angles(math.rad(60),0,math.pi/6), 0.2) | |
| 852 | ||
| 853 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 854 | ||
| 855 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 856 | ||
| 857 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05), .4) | |
| 858 | ||
| 859 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05), .4) | |
| 860 | end | |
| 861 | ||
| 862 | so("rbxassetid://152052659")
| |
| 863 | ||
| 864 | for i = 1, 20 do | |
| 865 | ||
| 866 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(0.5 ,0.3,-0.8)*CFrame.Angles(math.rad(60),0,-math.pi/3), 0.2) | |
| 867 | ||
| 868 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1,0.3,-0.4)*CFrame.Angles(math.rad(120),0,math.pi/6), 0.2) | |
| 869 | ||
| 870 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 871 | ||
| 872 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 873 | ||
| 874 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05), .4) | |
| 875 | ||
| 876 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05), .4) | |
| 877 | ||
| 878 | rs:wait() | |
| 879 | end | |
| 880 | ||
| 881 | EndEffect() | |
| 882 | NoAnims = false | |
| 883 | cooldown = 0 | |
| 884 | attacking = false | |
| 885 | elseif stance == "Katana" then | |
| 886 | ||
| 887 | attacking = true | |
| 888 | cooldown = 1 | |
| 889 | NoAnims = true | |
| 890 | NoSwordAnims = true | |
| 891 | stance = "Normal" | |
| 892 | for i = 1, 20 do | |
| 893 | end | |
| 894 | ||
| 895 | NoSwordAnims = false | |
| 896 | NoAnims = false | |
| 897 | cooldown = 0 | |
| 898 | attacking = false | |
| 899 | ||
| 900 | end | |
| 901 | end | |
| 902 | end | |
| 903 | end) | |
| 904 | ||
| 905 | ||
| 906 | -----------GUI creation-------------------- | |
| 907 | ||
| 908 | local pg = p.PlayerGui | |
| 909 | ||
| 910 | local sg = Instance.new("ScreenGui",pg)
| |
| 911 | sg.Name = "rage" | |
| 912 | ||
| 913 | local txt = Instance.new("TextLabel",sg)
| |
| 914 | txt.Position = UDim2.new(0.9, 0, 0.9, 0) | |
| 915 | txt.BackgroundTransparency = 1 | |
| 916 | txt.FontSize = "Size24" | |
| 917 | ||
| 918 | coroutine.wrap(function() | |
| 919 | while true do | |
| 920 | wait() | |
| 921 | txt.TextColor3 = Color3.new(ammo,ammo,ammo) | |
| 922 | end | |
| 923 | end)() | |
| 924 | ||
| 925 | coroutine.wrap(function() | |
| 926 | while true do | |
| 927 | wait() | |
| 928 | txt.Text = ammo.."/"..maxammo | |
| 929 | end | |
| 930 | end)() | |
| 931 | ||
| 932 | ---------------------------------------------- | |
| 933 | ------------------------------- | |
| 934 | local animpose = "Idle" | |
| 935 | local lastanimpose = "Idle" | |
| 936 | local sine = 0 | |
| 937 | local change = 1 | |
| 938 | local val = 0 | |
| 939 | local ffing = false | |
| 940 | local jump = false | |
| 941 | ------------------------------- | |
| 942 | local x = Instance.new("Sound", char)
| |
| 943 | x.SoundId = "http://www.roblox.com/asset/?id=429617891" | |
| 944 | x.Looped = true | |
| 945 | x.Volume = 1 | |
| 946 | x.Pitch = 1 | |
| 947 | local footsteps = false | |
| 948 | ------------------------------- | |
| 949 | game:GetService("RunService").RenderStepped:connect(function()
| |
| 950 | --[[if char.Humanoid.Jump == true then | |
| 951 | jump = true | |
| 952 | else | |
| 953 | jump = false | |
| 954 | end]] | |
| 955 | char.Humanoid.FreeFalling:connect(function(f) | |
| 956 | if f then | |
| 957 | ffing = true | |
| 958 | else | |
| 959 | ffing = false | |
| 960 | end | |
| 961 | end) | |
| 962 | sine = sine + change | |
| 963 | if jump == true then | |
| 964 | animpose = "Jumping" | |
| 965 | elseif ffing == true then | |
| 966 | animpose = "Freefalling" | |
| 967 | elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 2 then | |
| 968 | animpose = "Idle" | |
| 969 | elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 20 then | |
| 970 | animpose = "Walking" | |
| 971 | elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude > 20 then | |
| 972 | animpose = "Running" | |
| 973 | end | |
| 974 | if animpose ~= lastanimpose then | |
| 975 | sine = 0 | |
| 976 | if NoAnims == false then | |
| 977 | if animpose == "Idle" then | |
| 978 | for i = 1, 0.5 do | |
| 979 | ||
| 980 | if NoAnims == false then | |
| 981 | ||
| 982 | if stance == "Normal" then | |
| 983 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0),0,.05+ math.sin(sine/7)/14), 0.2) | |
| 984 | ||
| 985 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0),0,-.05+ -math.sin(sine/7)/14), 0.2) | |
| 986 | ||
| 987 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 988 | ||
| 989 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 990 | ||
| 991 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05+ math.sin(sine/7)/30), .4) | |
| 992 | ||
| 993 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05+ -math.sin(sine/7)/30), .4) | |
| 994 | ||
| 995 | elseif stance == "Katana" then | |
| 996 | ||
| 997 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0),0,.05+ math.sin(sine/7)/14), 0.2) | |
| 998 | ||
| 999 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0),math.pi,-.05+ -math.sin(sine/7)/14), 0.2) | |
| 1000 | ||
| 1001 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1002 | ||
| 1003 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1004 | ||
| 1005 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05+ math.sin(sine/7)/30), .4) | |
| 1006 | ||
| 1007 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05+ -math.sin(sine/7)/30), .4) | |
| 1008 | ||
| 1009 | end | |
| 1010 | ||
| 1011 | wait() | |
| 1012 | end | |
| 1013 | end | |
| 1014 | ||
| 1015 | ||
| 1016 | elseif animpose == "Running" then | |
| 1017 | change = 1 | |
| 1018 | if NoAnims == false then | |
| 1019 | ||
| 1020 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 * sizem,.3 * sizem,.1 * sizem)*CFrame.Angles(math.rad(-30),0,0), 0.2) | |
| 1021 | ||
| 1022 | larm.Weld.C0 =Lerp(larm.Weld.C0, CFrame.new(-1.5 * sizem,.3 * sizem,.1 * sizem)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1023 | ||
| 1024 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5 * sizem,0)*CFrame.Angles(math.rad(0),0,0),0.2) | |
| 1025 | ||
| 1026 | torso.Weld.C0 =Lerp(torso.Weld.C0, CFrame.new(0,1,0)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1027 | ||
| 1028 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-.5 * sizem - .2,-1 * sizem,0 * sizem)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1029 | ||
| 1030 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(.5 * sizem,-1 * sizem,0 * sizem)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1031 | ||
| 1032 | ||
| 1033 | ||
| 1034 | end | |
| 1035 | ||
| 1036 | elseif animpose == "Walking" then | |
| 1037 | for i = 1, 1.5 do | |
| 1038 | if NoAnims == false then | |
| 1039 | ||
| 1040 | if stance == "Normal" then | |
| 1041 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2,0,.2+ -math.sin(sine/7)/9), 0.2) | |
| 1042 | ||
| 1043 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0) + math.sin(sine/5)/2,0,-.2+ math.sin(sine/7)/9), 0.2) | |
| 1044 | ||
| 1045 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1046 | ||
| 1047 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1048 | ||
| 1049 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + math.sin(sine/5)/2, 0, 0+ math.sin(sine/7)/30), .4) | |
| 1050 | ||
| 1051 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2, 0, 0+ -math.sin(sine/7)/30), .4) | |
| 1052 | end | |
| 1053 | ||
| 1054 | elseif stance == "Katana" then | |
| 1055 | ||
| 1056 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2,0,.2+ -math.sin(sine/7)/9), 0.2) | |
| 1057 | ||
| 1058 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0) + math.sin(sine/5)/2,0,-.2+ math.sin(sine/7)/9), 0.2) | |
| 1059 | ||
| 1060 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1061 | ||
| 1062 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1063 | ||
| 1064 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + math.sin(sine/5)/2, 0, 0+ math.sin(sine/7)/30), .4) | |
| 1065 | ||
| 1066 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2, 0, 0+ -math.sin(sine/7)/30), .4) | |
| 1067 | ||
| 1068 | wait() | |
| 1069 | end | |
| 1070 | end | |
| 1071 | end | |
| 1072 | else | |
| 1073 | end | |
| 1074 | end | |
| 1075 | lastanimpose = animpose | |
| 1076 | if animpose == "Idle" then | |
| 1077 | change = 0.5 | |
| 1078 | if NoAnims == false then | |
| 1079 | ||
| 1080 | if stance == "Normal" then | |
| 1081 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0),0,.05+ math.sin(sine/7)/14), 0.2) | |
| 1082 | ||
| 1083 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0),0,-.05+ -math.sin(sine/7)/14), 0.2) | |
| 1084 | ||
| 1085 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1086 | ||
| 1087 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1088 | ||
| 1089 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05+ math.sin(sine/7)/30), .4) | |
| 1090 | ||
| 1091 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05+ -math.sin(sine/7)/30), .4) | |
| 1092 | ||
| 1093 | elseif stance == "Katana" then | |
| 1094 | ||
| 1095 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(0.5 ,0.3+ -math.sin(sine/14)/15,-0.8)*CFrame.Angles(math.rad(60),0,-math.pi/3+ math.sin(sine/7)/25), 0.2) | |
| 1096 | ||
| 1097 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1,0.3+ -math.sin(sine/14)/15,-0.4)*CFrame.Angles(math.rad(60),0,math.pi/6+ -math.sin(sine/7)/25), 0.2) | |
| 1098 | ||
| 1099 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1100 | ||
| 1101 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1102 | ||
| 1103 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, -0.05+ math.sin(sine/7)/30), .4) | |
| 1104 | ||
| 1105 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(0), 0, 0.05+ -math.sin(sine/7)/30), .4) | |
| 1106 | ||
| 1107 | end | |
| 1108 | end | |
| 1109 | ||
| 1110 | ||
| 1111 | elseif animpose == "Running" then | |
| 1112 | change = 1 | |
| 1113 | if NoAnims == false then | |
| 1114 | ||
| 1115 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 * sizem,.3 * sizem,.1 * sizem)*CFrame.Angles(math.rad(-30),0,0), 0.2) | |
| 1116 | ||
| 1117 | larm.Weld.C0 =Lerp(larm.Weld.C0, CFrame.new(-1.5 * sizem,.3 * sizem,.1 * sizem)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1118 | ||
| 1119 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5 * sizem,0)*CFrame.Angles(math.rad(0),0,0),0.2) | |
| 1120 | ||
| 1121 | torso.Weld.C0 =Lerp(torso.Weld.C0, CFrame.new(0,1,0)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1122 | ||
| 1123 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-.5 * sizem,-1 * sizem,0 * sizem)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1124 | ||
| 1125 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(.5 * sizem,-1 * sizem,0 * sizem)*CFrame.Angles(math.rad(-30),0,0),0.2) | |
| 1126 | ||
| 1127 | end | |
| 1128 | ||
| 1129 | elseif animpose == "Walking" then | |
| 1130 | change = 1 | |
| 1131 | ||
| 1132 | ||
| 1133 | if NoAnims == false then | |
| 1134 | ||
| 1135 | if stance == "Normal" then | |
| 1136 | ||
| 1137 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5 ,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2,0,.2+ -math.sin(sine/7)/9), 0.2) | |
| 1138 | ||
| 1139 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.6+ -math.sin(sine/14)/30,0)*CFrame.Angles(math.rad(0) + math.sin(sine/5)/2,0,-.2+ math.sin(sine/7)/9), 0.2) | |
| 1140 | ||
| 1141 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1142 | ||
| 1143 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1144 | ||
| 1145 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + math.sin(sine/5)/2, 0, 0+ math.sin(sine/7)/30), .4) | |
| 1146 | ||
| 1147 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2, 0, 0+ -math.sin(sine/7)/30), .4) | |
| 1148 | ||
| 1149 | elseif stance == "Katana" then | |
| 1150 | ||
| 1151 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(0.5 ,0.3+ -math.sin(sine/14)/15,-0.8)*CFrame.Angles(math.rad(60),0,-math.pi/3+ math.sin(sine/7)/25), 0.2) | |
| 1152 | ||
| 1153 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1,0.3+ -math.sin(sine/14)/15,-0.4)*CFrame.Angles(math.rad(60),0,math.pi/6+ -math.sin(sine/7)/25), 0.2) | |
| 1154 | ||
| 1155 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)),0.2) | |
| 1156 | ||
| 1157 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1 , 0) * CFrame.Angles(math.rad(0), 0, math.rad(0)), 0.2) | |
| 1158 | ||
| 1159 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + math.sin(sine/5)/2, 0, 0+ math.sin(sine/7)/30), .4) | |
| 1160 | ||
| 1161 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1 - 0.3*math.cos(sine/7)/6, 0) * CFrame.Angles(math.rad(0) + -math.sin(sine/5)/2, 0, 0+ -math.sin(sine/7)/30), .4) | |
| 1162 | ||
| 1163 | end | |
| 1164 | ||
| 1165 | end | |
| 1166 | end | |
| 1167 | if animpose == "Walking" then | |
| 1168 | if footsteps == false then | |
| 1169 | x:Play() | |
| 1170 | x.Pitch = ptz[math.random(1,#ptz)] | |
| 1171 | footsteps = true | |
| 1172 | end | |
| 1173 | x.Pitch = 1.1 | |
| 1174 | elseif animpose == "Idle" then | |
| 1175 | x:Stop() | |
| 1176 | footsteps = false | |
| 1177 | end | |
| 1178 | end) |