SHOW:
|
|
- or go back to the newest paste.
| 1 | - | --// By 1x1x1x1IAMbck from converted tool thx to Killersoldier45 \\-- |
| 1 | + | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
|
| 2 | - | -- have fun? |
| 2 | + | local Player,Mouse,mouse,UserInputService,ContextActionService = owner |
| 3 | - | -- Q for bring player |
| 3 | + | do |
| 4 | - | -- E to make player far |
| 4 | + | print("FE Compatibility code by Mokiros")
|
| 5 | - | -- R ლ(♥Ѡ♥ლ) remove part ლ(♥Ѡ♥ლ) |
| 5 | + | script.Parent = Player.Character |
| 6 | ||
| 7 | --RemoteEvent for communicating | |
| 8 | - | --Converted with ttyyuu12345's model to script plugin v4 |
| 8 | + | local Event = Instance.new("RemoteEvent")
|
| 9 | Event.Name = "UserInput_Event" | |
| 10 | ||
| 11 | --Fake event to make stuff like Mouse.KeyDown work | |
| 12 | local function fakeEvent() | |
| 13 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
| |
| 14 | t.connect = t.Connect | |
| 15 | return t | |
| 16 | end | |
| 17 | ||
| 18 | --Creating fake input objects with fake variables | |
| 19 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 20 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 21 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 22 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 23 | end} | |
| 24 | --Merged 2 functions into one by checking amount of arguments | |
| 25 | CAS.UnbindAction = CAS.BindAction | |
| 26 | ||
| 27 | --This function will trigger the events that have been :Connect()'ed | |
| 28 | local function te(self,ev,...) | |
| 29 | local t = m[ev] | |
| 30 | if t and t._fakeEvent and t.Function then | |
| 31 | t.Function(...) | |
| 32 | end | |
| 33 | end | |
| 34 | m.TrigEvent = te | |
| 35 | UIS.TrigEvent = te | |
| 36 | ||
| 37 | Event.OnServerEvent:Connect(function(plr,io) | |
| 38 | if plr~=Player then return end | |
| 39 | if io.isMouse then | |
| 40 | m.Target = io.Target | |
| 41 | m.Hit = io.Hit | |
| 42 | else | |
| 43 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 44 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 45 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 46 | end | |
| 47 | for _,t in pairs(CAS.Actions) do | |
| 48 | for _,k in pairs(t.Keys) do | |
| 49 | if k==io.KeyCode then | |
| 50 | t.Function(t.Name,io.UserInputState,io) | |
| 51 | end | |
| 52 | end | |
| 53 | end | |
| 54 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 55 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 56 | end | |
| 57 | end) | |
| 58 | Event.Parent = NLS([==[ | |
| 59 | local Player = game:GetService("Players").LocalPlayer
| |
| 60 | local Event = script:WaitForChild("UserInput_Event")
| |
| 61 | ||
| 62 | local UIS = game:GetService("UserInputService")
| |
| 63 | local input = function(io,a) | |
| 64 | if a then return end | |
| 65 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 66 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
| |
| 67 | end | |
| 68 | UIS.InputBegan:Connect(input) | |
| 69 | UIS.InputEnded:Connect(input) | |
| 70 | ||
| 71 | local Mouse = Player:GetMouse() | |
| 72 | local h,t | |
| 73 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 74 | --If player is not moving their mouse, client won't fire events | |
| 75 | while wait(1/30) do | |
| 76 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 77 | h,t=Mouse.Hit,Mouse.Target | |
| 78 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 79 | end | |
| 80 | end]==],Player.Character) | |
| 81 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
| 82 | end | |
| 83 | ||
| 84 | function sandbox(var,func) | |
| 85 | local env = getfenv(func) | |
| 86 | local newenv = setmetatable({},{
| |
| 87 | __index = function(self,k) | |
| 88 | if k=="script" then | |
| 89 | - | local player = game.Players.LocalPlayer |
| 89 | + | |
| 90 | else | |
| 91 | return env[k] | |
| 92 | end | |
| 93 | end, | |
| 94 | }) | |
| 95 | setfenv(func,newenv) | |
| 96 | return func | |
| 97 | end | |
| 98 | cors = {}
| |
| 99 | mas = Instance.new("Model",game:GetService("Lighting"))
| |
| 100 | Tool0 = Instance.new("Tool")
| |
| 101 | Part1 = Instance.new("Part")
| |
| 102 | CylinderMesh2 = Instance.new("CylinderMesh")
| |
| 103 | Part3 = Instance.new("Part")
| |
| 104 | LocalScript4 = Instance.new("LocalScript")
| |
| 105 | Script5 = Instance.new("Script")
| |
| 106 | LocalScript6 = Instance.new("LocalScript")
| |
| 107 | Script7 = Instance.new("Script")
| |
| 108 | MeshPart8 = Instance.new("MeshPart")
| |
| 109 | LocalScript9 = Instance.new("LocalScript")
| |
| 110 | Part10 = Instance.new("Part")
| |
| 111 | Script11 = Instance.new("Script")
| |
| 112 | Part12 = Instance.new("Part")
| |
| 113 | Script13 = Instance.new("Script")
| |
| 114 | Part14 = Instance.new("Part")
| |
| 115 | Script15 = Instance.new("Script")
| |
| 116 | Camera16 = Instance.new("Camera")
| |
| 117 | Tool0.Name = "Physics Gun" | |
| 118 | Tool0.Parent = mas | |
| 119 | Tool0.CanBeDropped = false | |
| 120 | Part1.Name = "Handle" | |
| 121 | Part1.Parent = Tool0 | |
| 122 | Part1.CFrame = CFrame.new(-6.38954401, 5.79334402, -31.4668274, 0.96399641, -4.98074878e-05, 0.265921414, 4.79998416e-05, 1, 1.32960558e-05, -0.265921414, -5.30653779e-08, 0.96399641) | |
| 123 | Part1.Orientation = Vector3.new(0, 15.4200001, 0) | |
| 124 | Part1.Position = Vector3.new(-6.38954401, 5.79334402, -31.4668274) | |
| 125 | Part1.Rotation = Vector3.new(0, 15.4200001, 0) | |
| 126 | Part1.Color = Color3.new(0.0156863, 0.686275, 0.92549) | |
| 127 | Part1.Transparency = 1 | |
| 128 | Part1.Size = Vector3.new(1, 0.400000036, 0.300000012) | |
| 129 | Part1.BottomSurface = Enum.SurfaceType.Smooth | |
| 130 | Part1.BrickColor = BrickColor.new("Cyan")
| |
| 131 | Part1.CanCollide = false | |
| 132 | Part1.Material = Enum.Material.Neon | |
| 133 | Part1.TopSurface = Enum.SurfaceType.Smooth | |
| 134 | Part1.brickColor = BrickColor.new("Cyan")
| |
| 135 | Part1.FormFactor = Enum.FormFactor.Custom | |
| 136 | Part1.formFactor = Enum.FormFactor.Custom | |
| 137 | CylinderMesh2.Parent = Part1 | |
| 138 | CylinderMesh2.Scale = Vector3.new(0.100000001, 0.100000001, 0.100000001) | |
| 139 | Part3.Name = "Shoot" | |
| 140 | Part3.Parent = Tool0 | |
| 141 | Part3.CFrame = CFrame.new(-5.9198041, 5.87110806, -32.6073456, -0.0245519895, 0.99968797, 0.00460194098, 0.0169109926, 0.00501798885, -0.999844491, -0.999555528, -0.0244703442, -0.0170289185) | |
| 142 | Part3.Orientation = Vector3.new(88.9899979, 164.87999, 73.4700012) | |
| 143 | Part3.Position = Vector3.new(-5.9198041, 5.87110806, -32.6073456) | |
| 144 | Part3.Rotation = Vector3.new(90.9799957, 0.25999999, -91.409996) | |
| 145 | Part3.Color = Color3.new(0.0156863, 0.686275, 0.92549) | |
| 146 | Part3.Transparency = 1 | |
| 147 | Part3.Size = Vector3.new(0.200000003, 0.25, 0.310000032) | |
| 148 | Part3.BottomSurface = Enum.SurfaceType.Smooth | |
| 149 | Part3.BrickColor = BrickColor.new("Cyan")
| |
| 150 | Part3.CanCollide = false | |
| 151 | Part3.Material = Enum.Material.Neon | |
| 152 | Part3.Reflectance = 0.30000001192093 | |
| 153 | Part3.TopSurface = Enum.SurfaceType.Smooth | |
| 154 | Part3.brickColor = BrickColor.new("Cyan")
| |
| 155 | Part3.FormFactor = Enum.FormFactor.Custom | |
| 156 | Part3.formFactor = Enum.FormFactor.Custom | |
| 157 | LocalScript4.Parent = Tool0 | |
| 158 | table.insert(cors,sandbox(LocalScript4,function() | |
| 159 | -- Variables for services | |
| 160 | local render = game:GetService("RunService").RenderStepped
| |
| 161 | local contextActionService = game:GetService("ContextActionService")
| |
| 162 | local userInputService = game:GetService("UserInputService")
| |
| 163 | ||
| 164 | local player = owner | |
| 165 | local mouse = player:GetMouse() | |
| 166 | local Tool = script.Parent | |
| 167 | ||
| 168 | -- Variables for Module Scripts | |
| 169 | local screenSpace = require(Tool:WaitForChild("ScreenSpace"))
| |
| 170 | ||
| 171 | local connection | |
| 172 | -- Variables for character joints | |
| 173 | ||
| 174 | local neck, shoulder, oldNeckC0, oldShoulderC0 | |
| 175 | ||
| 176 | local mobileShouldTrack = true | |
| 177 | ||
| 178 | -- Thourough check to see if a character is sitting | |
| 179 | local function amISitting(character) | |
| 180 | local t = character.Torso | |
| 181 | for _, part in pairs(t:GetConnectedParts(true)) do | |
| 182 | if part:IsA("Seat") or part:IsA("VehicleSeat") then
| |
| 183 | return true | |
| 184 | end | |
| 185 | end | |
| 186 | end | |
| 187 | ||
| 188 | -- Function to call on renderstepped. Orients the character so it is facing towards | |
| 189 | -- the player mouse's position in world space. If character is sitting then the torso | |
| 190 | -- should not track | |
| 191 | local function frame(mousePosition) | |
| 192 | -- Special mobile consideration. We don't want to track if the user was touching a ui | |
| 193 | -- element such as the movement controls. Just return out of function if so to make sure | |
| 194 | -- character doesn't track | |
| 195 | if not mobileShouldTrack then return end | |
| 196 | ||
| 197 | -- Make sure character isn't swiming. If the character is swimming the following code will | |
| 198 | -- not work well; the character will not swim correctly. Besides, who shoots underwater? | |
| 199 | if player.Character.Humanoid:GetState() ~= Enum.HumanoidStateType.Swimming then | |
| 200 | local torso = player.Character.Torso | |
| 201 | local head = player.Character.Head | |
| 202 | ||
| 203 | local toMouse = (mousePosition - head.Position).unit | |
| 204 | local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0))) | |
| 205 | ||
| 206 | local neckAngle = angle | |
| 207 | ||
| 208 | -- Limit how much the head can tilt down. Too far and the head looks unnatural | |
| 209 | if math.deg(neckAngle) > 110 then | |
| 210 | neckAngle = math.rad(110) | |
| 211 | end | |
| 212 | neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0) | |
| 213 | ||
| 214 | -- Calculate horizontal rotation | |
| 215 | local arm = player.Character:FindFirstChild("Right Arm")
| |
| 216 | local fromArmPos = torso.Position + torso.CFrame:vectorToWorldSpace(Vector3.new( | |
| 217 | torso.Size.X/2 + arm.Size.X/2, torso.Size.Y/2 - arm.Size.Z/2, 0)) | |
| 218 | local toMouseArm = ((mousePosition - fromArmPos) * Vector3.new(1,0,1)).unit | |
| 219 | local look = (torso.CFrame.lookVector * Vector3.new(1,0,1)).unit | |
| 220 | local lateralAngle = math.acos(toMouseArm:Dot(look)) | |
| 221 | ||
| 222 | -- Check for rogue math | |
| 223 | if tostring(lateralAngle) == "-1.#IND" then | |
| 224 | lateralAngle = 0 | |
| 225 | end | |
| 226 | ||
| 227 | -- Handle case where character is sitting down | |
| 228 | if player.Character.Humanoid:GetState() == Enum.HumanoidStateType.Seated then | |
| 229 | ||
| 230 | local cross = torso.CFrame.lookVector:Cross(toMouseArm) | |
| 231 | if lateralAngle > math.pi/2 then | |
| 232 | lateralAngle = math.pi/2 | |
| 233 | end | |
| 234 | if cross.Y < 0 then | |
| 235 | lateralAngle = -lateralAngle | |
| 236 | end | |
| 237 | end | |
| 238 | ||
| 239 | -- Turn shoulder to point to mouse | |
| 240 | shoulder.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2 + lateralAngle,0) | |
| 241 | ||
| 242 | -- If not sitting then aim torso laterally towards mouse | |
| 243 | if not amISitting(player.Character) then | |
| 244 | torso.CFrame = CFrame.new(torso.Position, torso.Position + (Vector3.new( | |
| 245 | mousePosition.X, torso.Position.Y, mousePosition.Z)-torso.Position).unit) | |
| 246 | else | |
| 247 | --print("sitting")
| |
| 248 | end | |
| 249 | end | |
| 250 | end | |
| 251 | ||
| 252 | -- Function to bind to render stepped if player is on PC | |
| 253 | local function pcFrame() | |
| 254 | frame(mouse.Hit.p) | |
| 255 | end | |
| 256 | ||
| 257 | -- Function to bind to touch moved if player is on mobile | |
| 258 | local function mobileFrame(touch, processed) | |
| 259 | -- Check to see if the touch was on a UI element. If so, we don't want to update anything | |
| 260 | if not processed then | |
| 261 | -- Calculate touch position in world space. Uses Stravant's ScreenSpace Module script | |
| 262 | -- to create a ray from the camera. | |
| 263 | local test = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1) | |
| 264 | local nearPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1)) | |
| 265 | nearPos = game.Workspace.CurrentCamera.CoordinateFrame.p - nearPos | |
| 266 | local farPos = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y,50) | |
| 267 | farPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(farPos) * -1 | |
| 268 | if farPos.magnitude > 900 then | |
| 269 | farPos = farPos.unit * 900 | |
| 270 | end | |
| 271 | local ray = Ray.new(nearPos, farPos) | |
| 272 | local part, pos = game.Workspace:FindPartOnRay(ray, player.Character) | |
| 273 | ||
| 274 | -- if a position was found on the ray then update the character's rotation | |
| 275 | if pos then | |
| 276 | frame(pos) | |
| 277 | end | |
| 278 | end | |
| 279 | end | |
| 280 | ||
| 281 | local oldIcon = nil | |
| 282 | -- Function to bind to equip event | |
| 283 | local function equip() | |
| 284 | local torso = player.Character.Torso | |
| 285 | ||
| 286 | -- Setup joint variables | |
| 287 | neck = torso.Neck | |
| 288 | oldNeckC0 = neck.C0 | |
| 289 | shoulder = torso:FindFirstChild("Right Shoulder")
| |
| 290 | oldShoulderC0 = shoulder.C0 | |
| 291 | ||
| 292 | -- Remember old mouse icon and update current | |
| 293 | oldIcon = mouse.Icon | |
| 294 | mouse.Icon = "rbxassetid:// 509381906" | |
| 295 | ||
| 296 | -- Bind TouchMoved event if on mobile. Otherwise connect to renderstepped | |
| 297 | if userInputService.TouchEnabled then | |
| 298 | connection = userInputService.TouchMoved:connect(mobileFrame) | |
| 299 | else | |
| 300 | connection = render:connect(pcFrame) | |
| 301 | end | |
| 302 | ||
| 303 | -- Bind TouchStarted and TouchEnded. Used to determine if character should rotate | |
| 304 | -- during touch input | |
| 305 | userInputService.TouchStarted:connect(function(touch, processed) | |
| 306 | mobileShouldTrack = not processed | |
| 307 | end) | |
| 308 | userInputService.TouchEnded:connect(function(touch, processed) | |
| 309 | mobileShouldTrack = false | |
| 310 | end) | |
| 311 | ||
| 312 | -- Fire server's equip event | |
| 313 | game.ReplicatedStorage.ROBLOX_PistolEquipEvent:FireServer() | |
| 314 | ||
| 315 | -- Bind event for when mouse is clicked to fire server's fire event | |
| 316 | mouse.Button1Down:connect(function() | |
| 317 | game.ReplicatedStorage.ROBLOX_PistolFireEvent:FireServer(mouse.Hit.p) | |
| 318 | end) | |
| 319 | ||
| 320 | -- Bind reload event to mobile button and r key | |
| 321 | contextActionService:BindActionToInputTypes("Reload", function()
| |
| 322 | game.ReplicatedStorage.ROBLOX_PistolReloadEvent:FireServer() | |
| 323 | end, true, "") | |
| 324 | ||
| 325 | -- If game uses filtering enabled then need to update server while tool is | |
| 326 | -- held by character. | |
| 327 | if workspace.FilteringEnabled then | |
| 328 | while connection do | |
| 329 | wait() | |
| 330 | game.ReplicatedStorage.ROBLOX_PistolUpdateEvent:FireServer(neck.C0, shoulder.C0) | |
| 331 | end | |
| 332 | end | |
| 333 | end | |
| 334 | ||
| 335 | -- Function to bind to Unequip event | |
| 336 | local function unequip() | |
| 337 | if connection then connection:disconnect() end | |
| 338 | contextActionService:UnbindAction("Reload")
| |
| 339 | game.ReplicatedStorage.ROBLOX_PistolUnequipEvent:FireServer() | |
| 340 | mouse.Icon = oldIcon | |
| 341 | neck.C0 = oldNeckC0 | |
| 342 | shoulder.C0 = oldShoulderC0 | |
| 343 | end | |
| 344 | ||
| 345 | -- Bind tool events | |
| 346 | Tool.Equipped:connect(equip) | |
| 347 | Tool.Unequipped:connect(unequip) | |
| 348 | end)) | |
| 349 | Script5.Name = "qPerfectionWeld" | |
| 350 | Script5.Parent = Tool0 | |
| 351 | table.insert(cors,sandbox(Script5,function() | |
| 352 | ||
| 353 | local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges). | |
| 354 | ||
| 355 | ||
| 356 | local function CallOnChildren(Instance, FunctionToCall) | |
| 357 | -- Calls a function on each of the children of a certain object, using recursion. | |
| 358 | ||
| 359 | FunctionToCall(Instance) | |
| 360 | ||
| 361 | for _, Child in next, Instance:GetChildren() do | |
| 362 | CallOnChildren(Child, FunctionToCall) | |
| 363 | end | |
| 364 | end | |
| 365 | ||
| 366 | local function GetNearestParent(Instance, ClassName) | |
| 367 | -- Returns the nearest parent of a certain class, or returns nil | |
| 368 | ||
| 369 | local Ancestor = Instance | |
| 370 | repeat | |
| 371 | Ancestor = Ancestor.Parent | |
| 372 | if Ancestor == nil then | |
| 373 | return nil | |
| 374 | end | |
| 375 | until Ancestor:IsA(ClassName) | |
| 376 | ||
| 377 | return Ancestor | |
| 378 | end | |
| 379 | ||
| 380 | local function GetBricks(StartInstance) | |
| 381 | local List = {}
| |
| 382 | ||
| 383 | -- if StartInstance:IsA("BasePart") then
| |
| 384 | -- List[#List+1] = StartInstance | |
| 385 | -- end | |
| 386 | ||
| 387 | CallOnChildren(StartInstance, function(Item) | |
| 388 | if Item:IsA("BasePart") then
| |
| 389 | List[#List+1] = Item; | |
| 390 | end | |
| 391 | end) | |
| 392 | ||
| 393 | return List | |
| 394 | end | |
| 395 | ||
| 396 | local function Modify(Instance, Values) | |
| 397 | -- Modifies an Instance by using a table. | |
| 398 | ||
| 399 | assert(type(Values) == "table", "Values is not a table"); | |
| 400 | ||
| 401 | for Index, Value in next, Values do | |
| 402 | if type(Index) == "number" then | |
| 403 | Value.Parent = Instance | |
| 404 | else | |
| 405 | Instance[Index] = Value | |
| 406 | end | |
| 407 | end | |
| 408 | return Instance | |
| 409 | end | |
| 410 | ||
| 411 | local function Make(ClassType, Properties) | |
| 412 | -- Using a syntax hack to create a nice way to Make new items. | |
| 413 | ||
| 414 | return Modify(Instance.new(ClassType), Properties) | |
| 415 | end | |
| 416 | ||
| 417 | local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
| |
| 418 | local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
| |
| 419 | ||
| 420 | local function HasWheelJoint(Part) | |
| 421 | for _, SurfaceName in pairs(Surfaces) do | |
| 422 | for _, HingSurfaceName in pairs(HingSurfaces) do | |
| 423 | if Part[SurfaceName].Name == HingSurfaceName then | |
| 424 | return true | |
| 425 | end | |
| 426 | end | |
| 427 | end | |
| 428 | ||
| 429 | return false | |
| 430 | end | |
| 431 | ||
| 432 | local function ShouldBreakJoints(Part) | |
| 433 | ||
| 434 | if NEVER_BREAK_JOINTS then | |
| 435 | return false | |
| 436 | end | |
| 437 | ||
| 438 | if HasWheelJoint(Part) then | |
| 439 | return false | |
| 440 | end | |
| 441 | ||
| 442 | local Connected = Part:GetConnectedParts() | |
| 443 | ||
| 444 | if #Connected == 1 then | |
| 445 | return false | |
| 446 | end | |
| 447 | ||
| 448 | for _, Item in pairs(Connected) do | |
| 449 | if HasWheelJoint(Item) then | |
| 450 | return false | |
| 451 | elseif not Item:IsDescendantOf(script.Parent) then | |
| 452 | return false | |
| 453 | end | |
| 454 | end | |
| 455 | ||
| 456 | return true | |
| 457 | end | |
| 458 | ||
| 459 | local function WeldTogether(Part0, Part1, JointType, WeldParent) | |
| 460 | JointType = JointType or "Weld" | |
| 461 | local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
| |
| 462 | ||
| 463 | local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
| |
| 464 | Modify(NewWeld, {
| |
| 465 | Name = "qCFrameWeldThingy"; | |
| 466 | Part0 = Part0; | |
| 467 | Part1 = Part1; | |
| 468 | C0 = CFrame.new();--Part0.CFrame:inverse(); | |
| 469 | C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse(); | |
| 470 | Parent = Part1; | |
| 471 | }) | |
| 472 | ||
| 473 | if not RelativeValue then | |
| 474 | RelativeValue = Make("CFrameValue", {
| |
| 475 | Parent = Part1; | |
| 476 | Name = "qRelativeCFrameWeldValue"; | |
| 477 | Archivable = true; | |
| 478 | Value = NewWeld.C1; | |
| 479 | }) | |
| 480 | end | |
| 481 | ||
| 482 | return NewWeld | |
| 483 | end | |
| 484 | ||
| 485 | local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor) | |
| 486 | for _, Part in pairs(Parts) do | |
| 487 | if ShouldBreakJoints(Part) then | |
| 488 | Part:BreakJoints() | |
| 489 | end | |
| 490 | end | |
| 491 | ||
| 492 | for _, Part in pairs(Parts) do | |
| 493 | if Part ~= MainPart then | |
| 494 | WeldTogether(MainPart, Part, JointType, MainPart) | |
| 495 | end | |
| 496 | end | |
| 497 | ||
| 498 | if not DoNotUnanchor then | |
| 499 | for _, Part in pairs(Parts) do | |
| 500 | Part.Anchored = false | |
| 501 | end | |
| 502 | MainPart.Anchored = false | |
| 503 | end | |
| 504 | end | |
| 505 | ||
| 506 | local function PerfectionWeld() | |
| 507 | local Tool = GetNearestParent(script, "Tool") | |
| 508 | ||
| 509 | local Parts = GetBricks(script.Parent) | |
| 510 | local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
| |
| 511 | ||
| 512 | if PrimaryPart then | |
| 513 | WeldParts(Parts, PrimaryPart, "Weld", false) | |
| 514 | else | |
| 515 | warn("qWeld - Unable to weld part")
| |
| 516 | end | |
| 517 | ||
| 518 | return Tool | |
| 519 | end | |
| 520 | ||
| 521 | local Tool = PerfectionWeld() | |
| 522 | ||
| 523 | ||
| 524 | if Tool and script.ClassName == "Script" then | |
| 525 | --- Don't bother with local scripts | |
| 526 | ||
| 527 | script.Parent.AncestryChanged:connect(function() | |
| 528 | PerfectionWeld() | |
| 529 | end) | |
| 530 | end | |
| 531 | ||
| 532 | ||
| 533 | end)) | |
| 534 | LocalScript6.Name = "Animate" | |
| 535 | LocalScript6.Parent = Tool0 | |
| 536 | table.insert(cors,sandbox(LocalScript6,function() | |
| 537 | local arms = nil | |
| 538 | local torso = nil | |
| 539 | local welds = {}
| |
| 540 | local Tool = script.Parent | |
| 541 | local neck = nil | |
| 542 | local orginalC0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
| 543 | ||
| 544 | function Equip(mouse) | |
| 545 | wait(0.01) | |
| 546 | arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
| |
| 547 | head = Tool.Parent:FindFirstChild("Head")
| |
| 548 | torso = Tool.Parent:FindFirstChild("Torso")
| |
| 549 | if neck == nil then | |
| 550 | neck = Tool.Parent:FindFirstChild("Torso").Neck
| |
| 551 | end | |
| 552 | if arms ~= nil and torso ~= nil then | |
| 553 | local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
| |
| 554 | if sh ~= nil then | |
| 555 | local yes = true | |
| 556 | if yes then | |
| 557 | yes = false | |
| 558 | sh[1].Part1 = nil | |
| 559 | sh[2].Part1 = nil | |
| 560 | local weld1 = Instance.new("Weld")
| |
| 561 | weld1.Part0 = head | |
| 562 | weld1.Parent = head | |
| 563 | weld1.Part1 = arms[1] | |
| 564 | welds[1] = weld1 | |
| 565 | local weld2 = Instance.new("Weld")
| |
| 566 | weld2.Part0 = head | |
| 567 | weld2.Parent = head | |
| 568 | weld2.Part1 = arms[2] | |
| 569 | welds[2] = weld2 | |
| 570 | -------------------------here | |
| 571 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
| 572 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 573 | mouse.Move:connect(function () | |
| 574 | --local Direction = Tool.Direction.Value | |
| 575 | local Direction = mouse.Hit.p | |
| 576 | local b = head.Position.Y-Direction.Y | |
| 577 | local dist = (head.Position-Direction).magnitude | |
| 578 | local answer = math.asin(b/dist) | |
| 579 | neck.C0=orginalC0*CFrame.fromEulerAnglesXYZ(answer,0,0) | |
| 580 | wait(0.1) | |
| 581 | end)end | |
| 582 | else | |
| 583 | print("sh")
| |
| 584 | end | |
| 585 | else | |
| 586 | print("arms")
| |
| 587 | end | |
| 588 | end | |
| 589 | ||
| 590 | function Unequip(mouse) | |
| 591 | if arms ~= nil and torso ~= nil then | |
| 592 | local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
| |
| 593 | if sh ~= nil then | |
| 594 | local yes = true | |
| 595 | if yes then | |
| 596 | yes = false | |
| 597 | neck.C0 = orginalC0 | |
| 598 | ||
| 599 | sh[1].Part1 = arms[1] | |
| 600 | sh[2].Part1 = arms[2] | |
| 601 | welds[1].Parent = nil | |
| 602 | welds[2].Parent = nil | |
| 603 | end | |
| 604 | else | |
| 605 | print("sh")
| |
| 606 | end | |
| 607 | else | |
| 608 | print("arms")
| |
| 609 | end | |
| 610 | end | |
| 611 | Tool.Equipped:connect(Equip) | |
| 612 | Tool.Unequipped:connect(Unequip) | |
| 613 | ||
| 614 | function Animate() | |
| 615 | arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
| |
| 616 | if Tool.AnimateValue.Value == "Shoot" then | |
| 617 | local weld1 = welds[1] | |
| 618 | local weld2 = welds[2] | |
| 619 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
| 620 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 621 | wait(0.00001) | |
| 622 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.05, math.rad(-90)) | |
| 623 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 624 | wait(0.00001) | |
| 625 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.1, math.rad(-90)) | |
| 626 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(-15), 0) | |
| 627 | wait(0.00001) | |
| 628 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.3, math.rad(-90)) | |
| 629 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0) | |
| 630 | wait(0.00001) | |
| 631 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.35, math.rad(-90)) | |
| 632 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-115), math.rad(-15), 0) | |
| 633 | wait(0.00001) | |
| 634 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 635 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 636 | wait(0.00001) | |
| 637 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
| 638 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 639 | Tool.AnimateValue.Value = "None" | |
| 640 | end | |
| 641 | if Tool.AnimateValue.Value == "Reload" then | |
| 642 | local weld1 = welds[1] | |
| 643 | local weld2 = welds[2] | |
| 644 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
| 645 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 646 | wait(0.0001) | |
| 647 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 648 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 649 | wait(0.0001) | |
| 650 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 651 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(-15), 0) | |
| 652 | wait(0.0001) | |
| 653 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 654 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-15), 0) | |
| 655 | wait(0.0001) | |
| 656 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 657 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-105), math.rad(-15), 0) | |
| 658 | wait(0.0001) | |
| 659 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 660 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0) | |
| 661 | wait(0.0001) | |
| 662 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90)) | |
| 663 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-115), math.rad(-15), 0) | |
| 664 | wait(0.0001) | |
| 665 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.45, math.rad(-90)) | |
| 666 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 667 | wait(0.0001) | |
| 668 | weld1.C1 = CFrame.new(-0.5+1.5, 0.9, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.5, math.rad(-90)) | |
| 669 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 670 | wait(0.0001) | |
| 671 | weld1.C1 = CFrame.new(-0.5+1.5, 1, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.55, math.rad(-90)) | |
| 672 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 673 | wait(0.0001) | |
| 674 | weld1.C1 = CFrame.new(-0.5+1.5, 1.1, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.57, math.rad(-90)) | |
| 675 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 676 | wait(0.0001) | |
| 677 | weld1.C1 = CFrame.new(-0.5+1.5, 1.2, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.6, math.rad(-90)) | |
| 678 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 679 | wait(0.0001) | |
| 680 | weld1.C1 = CFrame.new(-0.5+1.5, 1.3, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.6, math.rad(-90)) | |
| 681 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0) | |
| 682 | wait(0.0001) | |
| 683 | weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) | |
| 684 | weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) | |
| 685 | Tool.AnimateValue.Value = "None" | |
| 686 | end | |
| 687 | end | |
| 688 | ||
| 689 | Tool.AnimateValue.Changed:connect(Animate) | |
| 690 | ||
| 691 | end)) | |
| 692 | Script7.Name = "LineConnect" | |
| 693 | Script7.Parent = Tool0 | |
| 694 | table.insert(cors,sandbox(Script7,function() | |
| 695 | wait() | |
| 696 | local check = script.Part2 | |
| 697 | local part1 = script.Part1.Value | |
| 698 | local part2 = script.Part2.Value | |
| 699 | local parent = script.Par.Value | |
| 700 | local color = script.Color | |
| 701 | local line = Instance.new("Part")
| |
| 702 | line.TopSurface = 0 | |
| 703 | line.BottomSurface = 0 | |
| 704 | line.Reflectance = .5 | |
| 705 | line.Name = "Laser" | |
| 706 | line.Transparency = 0.6 | |
| 707 | line.Locked = true | |
| 708 | line.CanCollide = false | |
| 709 | line.Anchored = true | |
| 710 | line.formFactor = 0 | |
| 711 | line.Size = Vector3.new(0.4,0.4,1) | |
| 712 | local mesh = Instance.new("BlockMesh")
| |
| 713 | mesh.Parent = line | |
| 714 | while true do | |
| 715 | if (check.Value==nil) then break end | |
| 716 | if (part1==nil or part2==nil or parent==nil) then break end | |
| 717 | if (part1.Parent==nil or part2.Parent==nil) then break end | |
| 718 | if (parent.Parent==nil) then break end | |
| 719 | local lv = CFrame.new(part1.Position,part2.Position) | |
| 720 | local dist = (part1.Position-part2.Position).magnitude | |
| 721 | line.Parent = parent | |
| 722 | line.Material = "Neon" | |
| 723 | line.BrickColor = color.Value.BrickColor | |
| 724 | line.Reflectance = color.Value.Reflectance | |
| 725 | line.Transparency = "0.2" | |
| 726 | line.CFrame = CFrame.new(part1.Position+lv.lookVector*dist/2) | |
| 727 | line.CFrame = CFrame.new(line.Position,part2.Position) | |
| 728 | mesh.Scale = Vector3.new(.25,.25,dist) | |
| 729 | wait() | |
| 730 | end | |
| 731 | line:remove() | |
| 732 | script:remove() | |
| 733 | end)) | |
| 734 | Script7.Disabled = true | |
| 735 | MeshPart8.Parent = Tool0 | |
| 736 | MeshPart8.CFrame = CFrame.new(-6.17515802, 5.924335, -31.6297131, -0.999974906, 2.5773692e-05, -0.00732602458, 2.6000147e-05, 1, -3.08087401e-05, 0.00732602412, -3.09983407e-05, -0.999974906) | |
| 737 | MeshPart8.Orientation = Vector3.new(0, -179.580002, 0) | |
| 738 | MeshPart8.Position = Vector3.new(-6.17515802, 5.924335, -31.6297131) | |
| 739 | MeshPart8.Rotation = Vector3.new(180, -0.419999987, -180) | |
| 740 | MeshPart8.Size = Vector3.new(1.87063444, 1.44867194, 3.66569638) | |
| 741 | MeshPart8.TextureID = "rbxassetid://437276827" | |
| 742 | LocalScript9.Name = "MainScript" | |
| 743 | LocalScript9.Parent = Tool0 | |
| 744 | table.insert(cors,sandbox(LocalScript9,function() | |
| 745 | --Physics gun created by 1x1x1x1IAMbck | |
| 746 | wait() | |
| 747 | tool = script.Parent | |
| 748 | lineconnect = tool.LineConnect | |
| 749 | object = nil | |
| 750 | mousedown = false | |
| 751 | found = false | |
| 752 | BP = Instance.new("BodyPosition")
| |
| 753 | BP.maxForce = Vector3.new(math.huge*math.huge,math.huge*math.huge,math.huge*math.huge) --pwns everyone elses bodyposition | |
| 754 | BP.P = BP.P*10 --faster movement. less bounceback. | |
| 755 | dist = nil | |
| 756 | point = Instance.new("Part")
| |
| 757 | point.Locked = true | |
| 758 | point.Anchored = true | |
| 759 | point.formFactor = 0 | |
| 760 | point.Shape = 0 | |
| 761 | point.Material = 'Neon' | |
| 762 | point.BrickColor = BrickColor.new("Toothpaste")
| |
| 763 | point.Size = Vector3.new(1,1,1) | |
| 764 | point.CanCollide = false | |
| 765 | local mesh = Instance.new("SpecialMesh")
| |
| 766 | mesh.MeshType = "Sphere" | |
| 767 | mesh.Scale = Vector3.new(.2,.2,.2) | |
| 768 | mesh.Parent = point | |
| 769 | handle = tool.Shoot | |
| 770 | front = tool.Shoot | |
| 771 | color = tool.Shoot | |
| 772 | objval = nil | |
| 773 | local hooked = false | |
| 774 | local hookBP = BP:clone() | |
| 775 | hookBP.maxForce = Vector3.new(30000,30000,30000) | |
| 776 | ||
| 777 | function LineConnect(part1,part2,parent) | |
| 778 | local p1 = Instance.new("ObjectValue")
| |
| 779 | p1.Value = part1 | |
| 780 | p1.Name = "Part1" | |
| 781 | local p2 = Instance.new("ObjectValue")
| |
| 782 | p2.Value = part2 | |
| 783 | p2.Name = "Part2" | |
| 784 | local par = Instance.new("ObjectValue")
| |
| 785 | par.Value = parent | |
| 786 | par.Name = "Par" | |
| 787 | local col = Instance.new("ObjectValue")
| |
| 788 | col.Value = color | |
| 789 | col.Name = "Color" | |
| 790 | local s = lineconnect:clone() | |
| 791 | s.Disabled = false | |
| 792 | p1.Parent = s | |
| 793 | p2.Parent = s | |
| 794 | par.Parent = s | |
| 795 | col.Parent = s | |
| 796 | s.Parent = workspace | |
| 797 | if (part2==object) then | |
| 798 | objval = p2 | |
| 799 | end | |
| 800 | end | |
| 801 | ||
| 802 | function onButton1Down(mouse) | |
| 803 | if (mousedown==true) then return end | |
| 804 | mousedown = true | |
| 805 | coroutine.resume(coroutine.create(function() | |
| 806 | local p = point:clone() | |
| 807 | p.Parent = tool | |
| 808 | LineConnect(front,p,workspace) | |
| 809 | while (mousedown==true) do | |
| 810 | p.Parent = tool | |
| 811 | if (object==nil) then | |
| 812 | if (mouse.Target==nil) then | |
| 813 | local lv = CFrame.new(front.Position,mouse.Hit.p) | |
| 814 | p.CFrame = CFrame.new(front.Position+(lv.lookVector*1000)) | |
| 815 | else | |
| 816 | p.CFrame = CFrame.new(mouse.Hit.p) | |
| 817 | end | |
| 818 | else | |
| 819 | LineConnect(front,object,workspace) | |
| 820 | break | |
| 821 | end | |
| 822 | wait() | |
| 823 | end | |
| 824 | p:remove() | |
| 825 | end)) | |
| 826 | while (mousedown==true) do | |
| 827 | if (mouse.Target~=nil) then | |
| 828 | local t = mouse.Target | |
| 829 | if (t.Anchored==false) then | |
| 830 | object = t | |
| 831 | dist = (object.Position-front.Position).magnitude | |
| 832 | break | |
| 833 | end | |
| 834 | end | |
| 835 | wait() | |
| 836 | end | |
| 837 | while (mousedown==true) do | |
| 838 | if (object.Parent==nil) then break end | |
| 839 | local lv = CFrame.new(front.Position,mouse.Hit.p) | |
| 840 | BP.Parent = object | |
| 841 | BP.position = front.Position+lv.lookVector*dist | |
| 842 | wait() | |
| 843 | end | |
| 844 | BP:remove() | |
| 845 | object = nil | |
| 846 | objval.Value = nil | |
| 847 | end | |
| 848 | ||
| 849 | function onKeyDown(key,mouse) | |
| 850 | local key = key:lower() | |
| 851 | local yesh = false | |
| 852 | if (key=="q") then | |
| 853 | if (dist>=5) then | |
| 854 | dist = dist-5 | |
| 855 | end | |
| 856 | end | |
| 857 | if key == "" then | |
| 858 | if (object==nil) then return end | |
| 859 | for _,v in pairs(object:children()) do | |
| 860 | if v.className == "BodyGyro" then | |
| 861 | return nil | |
| 862 | end | |
| 863 | end | |
| 864 | BG = Instance.new("BodyGyro")
| |
| 865 | BG.maxTorque = Vector3.new(math.huge,math.huge,math.huge) | |
| 866 | BG.cframe = CFrame.new(object.CFrame.p) | |
| 867 | BG.Parent = object | |
| 868 | repeat wait() until(object.CFrame == CFrame.new(object.CFrame.p)) | |
| 869 | BG.Parent = nil | |
| 870 | if (object==nil) then return end | |
| 871 | for _,v in pairs(object:children()) do | |
| 872 | if v.className == "BodyGyro" then | |
| 873 | v.Parent = nil | |
| 874 | end | |
| 875 | end | |
| 876 | object.Velocity = Vector3.new(0,0,0) | |
| 877 | object.RotVelocity = Vector3.new(0,0,0) | |
| 878 | end | |
| 879 | if (key=="e") then | |
| 880 | dist = dist+5 | |
| 881 | end | |
| 882 | if (string.byte(key)==27) then | |
| 883 | if (object==nil) then return end | |
| 884 | local e = Instance.new("Explosion")
| |
| 885 | e.Parent = workspace | |
| 886 | e.Position = object.Position | |
| 887 | color.BrickColor = BrickColor.Black() | |
| 888 | point.BrickColor = BrickColor.White() | |
| 889 | wait(.48) | |
| 890 | color.BrickColor = BrickColor.White() | |
| 891 | point.BrickColor = BrickColor.Black() | |
| 892 | end | |
| 893 | if (key=="") then | |
| 894 | if not hooked then | |
| 895 | if (object==nil) then return end | |
| 896 | hooked = true | |
| 897 | hookBP.position = object.Position | |
| 898 | if tool.Parent:findFirstChild("Torso") then
| |
| 899 | hookBP.Parent = tool.Parent.Torso | |
| 900 | if dist ~= (object.Size.x+object.Size.y+object.Size.z)+5 then | |
| 901 | dist = (object.Size.x+object.Size.y+object.Size.z)+5 | |
| 902 | end | |
| 903 | end | |
| 904 | else | |
| 905 | hooked = false | |
| 906 | hookBP.Parent = nil | |
| 907 | end | |
| 908 | end | |
| 909 | if (key=="r") then | |
| 910 | if (object==nil) then return end | |
| 911 | color.BrickColor = BrickColor.new("Toothpaste")
| |
| 912 | point.BrickColor = BrickColor.new("Toothpaste")
| |
| 913 | object.Parent = nil | |
| 914 | wait(.48) | |
| 915 | color.BrickColor = BrickColor.new("Toothpaste")
| |
| 916 | point.BrickColor = BrickColor.new("Toothpaste")
| |
| 917 | end | |
| 918 | if (key=="") then | |
| 919 | if (object==nil) then return end | |
| 920 | local New = object:clone() | |
| 921 | New.Parent = object.Parent | |
| 922 | for _,v in pairs(New:children()) do | |
| 923 | if v.className == "BodyPosition" or v.className == "BodyGyro" then | |
| 924 | v.Parent = nil | |
| 925 | end | |
| 926 | end | |
| 927 | object = New | |
| 928 | mousedown = false | |
| 929 | mousedown = true | |
| 930 | LineConnect(front,object,workspace) | |
| 931 | while (mousedown==true) do | |
| 932 | if (object.Parent==nil) then break end | |
| 933 | local lv = CFrame.new(front.Position,mouse.Hit.p) | |
| 934 | BP.Parent = object | |
| 935 | BP.position = front.Position+lv.lookVector*dist | |
| 936 | wait() | |
| 937 | end | |
| 938 | BP:remove() | |
| 939 | object = nil | |
| 940 | objval.Value = nil | |
| 941 | end | |
| 942 | if (key=="") then | |
| 943 | local Cube = Instance.new("Part")
| |
| 944 | Cube.Locked = true | |
| 945 | Cube.Size = Vector3.new(4,4,4) | |
| 946 | Cube.formFactor = 0 | |
| 947 | Cube.TopSurface = 0 | |
| 948 | Cube.BottomSurface = 0 | |
| 949 | Cube.Name = "WeightedStorageCube" | |
| 950 | Cube.Parent = workspace | |
| 951 | Cube.CFrame = CFrame.new(mouse.Hit.p) + Vector3.new(0,2,0) | |
| 952 | for i = 0,5 do | |
| 953 | local Decal = Instance.new("Decal")
| |
| 954 | Decal.Texture = "http://www.roblox.com/asset/?id=2662260" | |
| 955 | Decal.Face = i | |
| 956 | Decal.Name = "WeightedStorageCubeDecal" | |
| 957 | Decal.Parent = Cube | |
| 958 | end | |
| 959 | end | |
| 960 | if (key=="") then | |
| 961 | if dist ~= 15 then | |
| 962 | dist = 15 | |
| 963 | end | |
| 964 | end | |
| 965 | end | |
| 966 | ||
| 967 | function onEquipped(mouse) | |
| 968 | keymouse = mouse | |
| 969 | local char = tool.Parent | |
| 970 | human = char.Humanoid | |
| 971 | human.Changed:connect(function() if (human.Health==0) then mousedown = false BP:remove() point:remove() tool:remove() end end) | |
| 972 | mouse.Button1Down:connect(function() onButton1Down(mouse) end) | |
| 973 | mouse.Button1Up:connect(function() mousedown = false end) | |
| 974 | mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end) | |
| 975 | mouse.Icon = "rbxassetid:// 509381906" | |
| 976 | end | |
| 977 | ||
| 978 | tool.Equipped:connect(onEquipped) | |
| 979 | end)) | |
| 980 | Part10.Name = "GlowPart" | |
| 981 | Part10.Parent = Tool0 | |
| 982 | Part10.CFrame = CFrame.new(-5.9391551, 5.8703599, -31.9022942, 0.00736002205, 4.68389771e-11, -0.999974668, 4.72937245e-11, 1, 1.41590961e-10, 0.999974668, 5.09317033e-11, 0.00736002252) | |
| 983 | Part10.Orientation = Vector3.new(0, -89.5799942, 0) | |
| 984 | Part10.Position = Vector3.new(-5.9391551, 5.8703599, -31.9022942) | |
| 985 | Part10.Rotation = Vector3.new(0, -89.5899963, 0) | |
| 986 | Part10.Color = Color3.new(0.0156863, 0.686275, 0.92549) | |
| 987 | Part10.Transparency = 0.5 | |
| 988 | Part10.Size = Vector3.new(1.20000005, 0.649999976, 2) | |
| 989 | Part10.BrickColor = BrickColor.new("Cyan")
| |
| 990 | Part10.Material = Enum.Material.Neon | |
| 991 | Part10.brickColor = BrickColor.new("Cyan")
| |
| 992 | Part10.Shape = Enum.PartType.Cylinder | |
| 993 | Script11.Name = "Glow Script" | |
| 994 | Script11.Parent = Part10 | |
| 995 | table.insert(cors,sandbox(Script11,function() | |
| 996 | while true do | |
| 997 | wait(0.05) | |
| 998 | script.Parent.Transparency = .5 | |
| 999 | wait(0.05) | |
| 1000 | script.Parent.Transparency = .6 | |
| 1001 | wait(0.05) | |
| 1002 | script.Parent.Transparency = .7 | |
| 1003 | wait(0.05) | |
| 1004 | script.Parent.Transparency = .8 | |
| 1005 | wait(0.05) | |
| 1006 | script.Parent.Transparency = .9 | |
| 1007 | wait(0.05) | |
| 1008 | script.Parent.Transparency = .8 | |
| 1009 | wait(0.05) | |
| 1010 | script.Parent.Transparency = .7 | |
| 1011 | wait(0.05) | |
| 1012 | script.Parent.Transparency = .6 | |
| 1013 | wait(0.05) | |
| 1014 | script.Parent.Transparency = .5 | |
| 1015 | end | |
| 1016 | ||
| 1017 | end)) | |
| 1018 | Part12.Name = "GlowPart" | |
| 1019 | Part12.Parent = Tool0 | |
| 1020 | Part12.CFrame = CFrame.new(-6.1008749, 6.09524679, -31.0506268, 0.00736002205, 0.562958956, -0.826454222, 4.72937245e-11, 0.826475084, 0.56297338, 0.999974668, -0.00414349511, 0.00608287565) | |
| 1021 | Part12.Orientation = Vector3.new(-34.2599983, -89.5799942, 0) | |
| 1022 | Part12.Position = Vector3.new(-6.1008749, 6.09524679, -31.0506268) | |
| 1023 | Part12.Rotation = Vector3.new(-89.3799973, -55.7399979, -89.25) | |
| 1024 | Part12.Color = Color3.new(0.0156863, 0.686275, 0.92549) | |
| 1025 | - | v.Parent = game:GetService("Players").LocalPlayer.Backpack
|
| 1025 | + | |
| 1026 | Part12.Size = Vector3.new(0.280000001, 0.25999999, 0.200000003) | |
| 1027 | Part12.BrickColor = BrickColor.new("Cyan")
| |
| 1028 | Part12.Material = Enum.Material.Neon | |
| 1029 | Part12.brickColor = BrickColor.new("Cyan")
| |
| 1030 | Script13.Name = "Glow Script" | |
| 1031 | Script13.Parent = Part12 | |
| 1032 | table.insert(cors,sandbox(Script13,function() | |
| 1033 | while true do | |
| 1034 | wait(0.05) | |
| 1035 | script.Parent.Transparency = .5 | |
| 1036 | wait(0.05) | |
| 1037 | script.Parent.Transparency = .6 | |
| 1038 | wait(0.05) | |
| 1039 | script.Parent.Transparency = .7 | |
| 1040 | wait(0.05) | |
| 1041 | script.Parent.Transparency = .8 | |
| 1042 | wait(0.05) | |
| 1043 | script.Parent.Transparency = .9 | |
| 1044 | wait(0.05) | |
| 1045 | script.Parent.Transparency = .8 | |
| 1046 | wait(0.05) | |
| 1047 | script.Parent.Transparency = .7 | |
| 1048 | wait(0.05) | |
| 1049 | script.Parent.Transparency = .6 | |
| 1050 | wait(0.05) | |
| 1051 | script.Parent.Transparency = .5 | |
| 1052 | end | |
| 1053 | ||
| 1054 | end)) | |
| 1055 | Part14.Name = "GlowPart" | |
| 1056 | Part14.Parent = Tool0 | |
| 1057 | Part14.CFrame = CFrame.new(-5.71092081, 6.07523823, -31.0506268, -0.0830051303, -0.584483683, -0.807150841, 0.0241250042, 0.808528602, -0.58796227, 0.996258855, -0.0682764053, -0.0530113392) | |
| 1058 | Part14.Orientation = Vector3.new(36.0099983, -93.7599945, 1.70999992) | |
| 1059 | Part14.Position = Vector3.new(-5.71092081, 6.07523823, -31.0506268) | |
| 1060 | Part14.Rotation = Vector3.new(95.1500015, -53.8199997, 98.0799942) | |
| 1061 | Part14.Color = Color3.new(0.0156863, 0.686275, 0.92549) | |
| 1062 | Part14.Transparency = 0.5 | |
| 1063 | Part14.Size = Vector3.new(0.280000001, 0.25999999, 0.200000003) | |
| 1064 | Part14.BrickColor = BrickColor.new("Cyan")
| |
| 1065 | Part14.Material = Enum.Material.Neon | |
| 1066 | Part14.brickColor = BrickColor.new("Cyan")
| |
| 1067 | Script15.Name = "Glow Script" | |
| 1068 | Script15.Parent = Part14 | |
| 1069 | table.insert(cors,sandbox(Script15,function() | |
| 1070 | while true do | |
| 1071 | wait(0.05) | |
| 1072 | script.Parent.Transparency = .5 | |
| 1073 | wait(0.05) | |
| 1074 | script.Parent.Transparency = .6 | |
| 1075 | wait(0.05) | |
| 1076 | script.Parent.Transparency = .7 | |
| 1077 | wait(0.05) | |
| 1078 | script.Parent.Transparency = .8 | |
| 1079 | wait(0.05) | |
| 1080 | script.Parent.Transparency = .9 | |
| 1081 | wait(0.05) | |
| 1082 | script.Parent.Transparency = .8 | |
| 1083 | wait(0.05) | |
| 1084 | script.Parent.Transparency = .7 | |
| 1085 | wait(0.05) | |
| 1086 | script.Parent.Transparency = .6 | |
| 1087 | wait(0.05) | |
| 1088 | script.Parent.Transparency = .5 | |
| 1089 | end | |
| 1090 | ||
| 1091 | end)) | |
| 1092 | Camera16.Name = "ThumbnailCamera" | |
| 1093 | Camera16.Parent = Tool0 | |
| 1094 | Camera16.CFrame = CFrame.new(-72.6014481, 2.66755652, -7.33538532, -0.38762787, 0.0869381726, -0.917707145, 7.45058149e-09, 0.995542765, 0.0943118483, 0.921816051, 0.0365578942, -0.38590005) | |
| 1095 | Camera16.CoordinateFrame = CFrame.new(-72.6014481, 2.66755652, -7.33538532, -0.38762787, 0.0869381726, -0.917707145, 7.45058149e-09, 0.995542765, 0.0943118483, 0.921816051, 0.0365578942, -0.38590005) | |
| 1096 | Camera16.FieldOfView = 9.999999825821 | |
| 1097 | Camera16.Focus = CFrame.new(-70.7660294, 2.47893238, -6.56358337, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
| 1098 | Camera16.focus = CFrame.new(-70.7660294, 2.47893238, -6.56358337, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
| 1099 | for i,v in pairs(mas:GetChildren()) do | |
| 1100 | v.Parent = owner.Backpack | |
| 1101 | pcall(function() v:MakeJoints() end) | |
| 1102 | end | |
| 1103 | mas:Destroy() | |
| 1104 | for i,v in pairs(cors) do | |
| 1105 | spawn(function() | |
| 1106 | pcall(v) | |
| 1107 | end) | |
| 1108 | end |