Advertisement
idkwhatiam

snowball

May 17th, 2019
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.98 KB | None | 0 0
  1. --Snowball Script.--
  2.  
  3. if game:GetService("RunService"):IsClient()then error("Script can only be ran as FE. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  4. do
  5.     script.Parent = owner.Character
  6.     local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  7.     local function NewFakeEvent()
  8.         local Bind = Instance.new("BindableEvent")
  9.         local Fake;Fake = {Connections = {},
  10.         fakeEvent=true;
  11.         Connect=function(self,Func)
  12.             Bind.Event:connect(Func)
  13.             self.Connections[Bind] = true
  14.             return setmetatable({Connected = true},{
  15.             __index = function (self,Index)
  16.                 if Index:lower() == "disconnect" then
  17.                     return function() Fake.Connections[Bind] = false;self.Connected = false end
  18.                 end
  19.                 return Fake[Index]
  20.             end;
  21.             __tostring = function() return "Connection" end;
  22.         })
  23.         end}
  24.         Fake.connect = Fake.Connect;return Fake;
  25.     end
  26.     local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  27.     local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  28.     local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  29.         self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  30.     end};ContextActionService.UnBindAction = ContextActionService.BindAction
  31.     local function TriggerEvent(self,Event,...)
  32.         local Trigger = Mouse[Event]
  33.         if Trigger and Trigger.fakeEvent and Trigger.Connections then
  34.             for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  35.         end
  36.     end
  37.     Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  38.     Event.OnServerEvent:Connect(function(FiredBy,Input)
  39.         if FiredBy.Name ~= owner.Name then return end
  40.         if Input.MouseEvent then
  41.             Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  42.         else
  43.             local Begin = Input.UserInputState == Enum.UserInputState.Begin
  44.             if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  45.             for _,Action in pairs(ContextActionService.Actions) do
  46.                 for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  47.             end
  48.             Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  49.             UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  50.         end
  51.     end)
  52.     InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  53.     Event.Parent = NLS([[
  54.         local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  55.         local Input = function(Input,gameProcessedEvent)
  56.             if gameProcessedEvent then return end
  57.             Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  58.         end
  59.         UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  60.         local Hit,Target
  61.         while wait(1/30) do
  62.             if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  63.                 Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  64.             end
  65.         end
  66.     ]],owner.Character)
  67. end
  68. RealGame = game;game = setmetatable({},{
  69.     __index = function (self,Index)
  70.         local Sandbox = function (Thing)
  71.             if Thing:IsA("Player") then
  72.                 local RealPlayer = Thing
  73.                 return setmetatable({},{
  74.                     __index = function (self,Index)
  75.                         local Type = type(RealPlayer[Index])
  76.                         if Type == "function" then
  77.                             if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  78.                                 return function (self)return InternalData["Mouse"] end
  79.                             end
  80.                             return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  81.                         end
  82.                         return RealPlayer[Index]
  83.                     end;
  84.                     __tostring = function(self) return RealPlayer.Name end
  85.                 })
  86.             end
  87.         end
  88.         if RealGame[Index] then
  89.             local Type = type(RealGame[Index])
  90.             if Type == "function" then
  91.                 if Index:lower() == "getservice" or Index:lower() == "service" then
  92.                     return function (self,Service)
  93.                         local FakeServices = {
  94.                             ["players"] = function()
  95.                                 return setmetatable({},{
  96.                                     __index = function (self2,Index2)
  97.                                         local RealService = RealGame:GetService(Service)
  98.                                         local Type2 = type(Index2)
  99.                                         if Type2 == "function" then
  100.                                             return function (self,...) return RealService[Index2](RealService,...)end
  101.                                         else
  102.                                             if Index2:lower() == "localplayer" then return Sandbox(owner) end
  103.                                             return RealService[Index2]
  104.                                         end
  105.                                     end;
  106.                                     __tostring = function(self) return RealGame:GetService(Service).Name end
  107.                                 })
  108.                             end;
  109.                             ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  110.                             ["userinputservice"] = function() return InternalData["UserInputService"] end;
  111.                             ["runservice"] = function()
  112.                                 return setmetatable({},{
  113.                                     __index = function(self2,Index2)
  114.                                         local RealService = RealGame:GetService(Service)
  115.                                         local Type2 = type(Index2)
  116.                                         if Type2 == "function" then
  117.                                             return function (self,...) return RealService[Index2](RealService,...) end
  118.                                         else
  119.                                             local RunServices = {
  120.                                                 ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  121.                                                 ["renderstepped"] = function() return RealService["Stepped"] end
  122.                                             }
  123.                                             if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  124.                                             return RealService[Index2]
  125.                                         end
  126.                                     end
  127.                                 })
  128.                             end
  129.                         }
  130.                         if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  131.                         return RealGame:GetService(Service)
  132.                     end
  133.                 end
  134.                 return function (self,...) return RealGame[Index](RealGame,...) end
  135.             else
  136.                 if game:GetService(Index) then return game:GetService(Index) end
  137.                 return RealGame[Index]
  138.             end
  139.         end
  140.         return nil
  141.     end
  142.         });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  143.        
  144. plr = owner
  145. char = plr.Character
  146. mouse = plr:GetMouse()
  147.  
  148. tors = char.Torso
  149. hed = char.Head
  150. rightarm = char["Right Arm"]
  151. leftarm = char["Left Arm"]
  152. leftleg = char["Left Leg"]
  153. rightleg = char["Right Leg"]
  154. root = char.HumanoidRootPart
  155.  
  156. mat = "Sand"
  157. bc = BrickColor.new("Institutional white")
  158. size = Vector3.new(1, 1, 1)
  159. shape = "Ball"
  160.  
  161. hasball = false
  162. launching = false
  163.  
  164. mouse.Button1Down:Connect(function()
  165.     if hasball == false then
  166.         hasball = true
  167.         arm = Instance.new("Weld")
  168.         arm.Parent = leftarm
  169.         arm.Part0 = leftarm
  170.         arm.Part1 = tors
  171.         arm.C0 = CFrame.new(1.5, 0, 0)
  172.        
  173.         torso = Instance.new("Weld")
  174.         torso.Parent = tors
  175.         torso.Part0 = tors
  176.         torso.Part1 = root
  177.         torso.C1 = CFrame.Angles(-0.25, 0, 0)
  178.         wait(0.05)
  179.         torso.C1 = CFrame.Angles(-0.5, 0, 0)
  180.         wait(0.05)
  181.         torso.C1 = CFrame.Angles(-0.75, 0, 0)
  182.         wait(0.05)
  183.         torso.C1 = CFrame.Angles(-1, 0, 0)
  184.         torso.C0 = CFrame.new(0, 1.25, 0)
  185.         arm.C1 = CFrame.Angles(90, 0, 0)
  186.         wait(0.05)
  187.         torso.C1 = CFrame.Angles(-0.75, 0, 0)
  188.         wait(0.05)
  189.         torso.C1 = CFrame.Angles(-0.5, 0, 0)
  190.         wait(0.05)
  191.         torso.C1 = CFrame.Angles(-0.25, 0, 0)
  192.         wait(0.05)
  193.         torso.C1 = CFrame.Angles(0, 0, 0)
  194.         torso.C0 = CFrame.new(0, 0, 0)
  195.         snowball = Instance.new("Part")
  196.         snowball.Parent = leftarm
  197.         snowball.Name = "SNOWBALL_FIGHT_SNOW"
  198.         snowball.Size = size
  199.         snowball.Shape = shape
  200.         snowball.BrickColor = bc
  201.         snowball.Material = mat
  202.         snowball.CanCollide = true
  203.         weld = Instance.new("Weld")
  204.         weld.Parent = snowball
  205.         weld.Part0 = snowball
  206.         weld.Part1 = leftarm
  207.         weld.C0 = CFrame.new(0, 0.85, 0)
  208.     end
  209. end)
  210.  
  211. mouse.Button1Down:connect(function()
  212.     if hasball == true then
  213.         char.Humanoid.WalkSpeed = 0
  214.         launching = true
  215.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  216.         snowball.Touched:Connect(function(hit)
  217.             weld:Destroy()
  218.             snowball.Anchored = false
  219.             hah = hit.Parent
  220.             hah.Humanoid.Health = hah.Humanoid.Health - 25
  221.         end)
  222.         wait(0.05)
  223.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  224.         wait(0.05)
  225.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  226.         wait(0.05)
  227.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  228.         wait(0.05)
  229.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  230.         wait(0.05)
  231.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  232.         wait(0.05)
  233.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  234.         wait(0.05)
  235.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  236.         wait(0.05)
  237.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  238.         wait(0.05)
  239.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  240.         wait(0.05)
  241.         weld.C0 = weld.C0 + Vector3.new(0, 1.5, 0)
  242.         wait(0.05)
  243.         snowball.Anchored = false
  244.         weld:Destroy()
  245.         arm:Destroy()
  246.         torso:Destroy()
  247.         hasball = false
  248.         launching = false
  249.         char.Humanoid.WalkSpeed = 16
  250.         wait(2)
  251.         snowball:Destroy()
  252.     end    
  253. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement