Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.96 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. local rp = RealPlayer
  6. script.Parent = rp.Character
  7.  
  8. --RemoteEvent for communicating
  9. local Event = Instance.new("RemoteEvent")
  10. Event.Name = "UserInput_Event"
  11.  
  12. --Fake event to make stuff like Mouse.KeyDown work
  13. local function fakeEvent()
  14. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  15. t.connect = t.Connect
  16. return t
  17. end
  18.  
  19. --Creating fake input objects with fake variables
  20. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  21. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  22. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  23. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  24. end}
  25. --Merged 2 functions into one by checking amount of arguments
  26. CAS.UnbindAction = CAS.BindAction
  27.  
  28. --This function will trigger the events that have been :Connect()'ed
  29. local function te(self,ev,...)
  30. local t = m[ev]
  31. if t and t._fakeEvent then
  32. for _,f in pairs(t.Functions) do
  33. f(...)
  34. end
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=rp then return end
  42. m.Target = io.Target
  43. m.Hit = io.Hit
  44. if not io.isMouse then
  45. local b = io.UserInputState == Enum.UserInputState.Begin
  46. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  47. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  48. end
  49. for _,t in pairs(CAS.Actions) do
  50. for _,k in pairs(t.Keys) do
  51. if k==io.KeyCode then
  52. t.Function(t.Name,io.UserInputState,io)
  53. end
  54. end
  55. end
  56. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  57. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  58. end
  59. end)
  60. Event.Parent = NLS([==[
  61. local Player = game:GetService("Players").LocalPlayer
  62. local Event = script:WaitForChild("UserInput_Event")
  63.  
  64. local Mouse = Player:GetMouse()
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local h,t
  75. --Give the server mouse data 30 times every second, but only if the values changed
  76. --If player is not moving their mouse, client won't fire events
  77. while wait(1/30) do
  78. if h~=Mouse.Hit or t~=Mouse.Target then
  79. h,t=Mouse.Hit,Mouse.Target
  80. Event:FireServer({isMouse=true,Target=t,Hit=h})
  81. end
  82. end]==],Player.Character)
  83.  
  84. ----Sandboxed game object that allows the usage of client-side methods and services
  85. --Real game object
  86. local _rg = game
  87.  
  88. --Metatable for fake service
  89. local fsmt = {
  90. __index = function(self,k)
  91. local s = rawget(self,"_RealService")
  92. if s then return s[k] end
  93. end,
  94. __newindex = function(self,k,v)
  95. local s = rawget(self,"_RealService")
  96. if s then s[k]=v end
  97. end,
  98. __call = function(self,...)
  99. local s = rawget(self,"_RealService")
  100. if s then return s(...) end
  101. end
  102. }
  103. local function FakeService(t,RealService)
  104. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  105. return setmetatable(t,fsmt)
  106. end
  107.  
  108. --Fake game object
  109. local g = {
  110. GetService = function(self,s)
  111. return self[s]
  112. end,
  113. Players = FakeService({
  114. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  115. },"Players"),
  116. UserInputService = FakeService(UIS,"UserInputService"),
  117. ContextActionService = FakeService(CAS,"ContextActionService"),
  118. }
  119. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  120. g.service = g.GetService
  121.  
  122. g.RunService = FakeService({
  123. RenderStepped = _rg:GetService("RunService").Heartbeat,
  124. BindToRenderStep = function(self,name,_,fun)
  125. self._btrs[name] = self.Heartbeat:Connect(fun)
  126. end,
  127. UnbindFromRenderStep = function(self,name)
  128. self._btrs[name]:Disconnect()
  129. end,
  130. },"RunService")
  131.  
  132. setmetatable(g,{
  133. __index=function(self,s)
  134. return _rg:GetService(s) or typeof(_rg[s])=="function"
  135. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  136. end,
  137. __newindex = fsmt.__newindex,
  138. __call = fsmt.__call
  139. })
  140. --Changing owner to fake player object to support owner:GetMouse()
  141. game,owner = g,g.Players.LocalPlayer
  142. end
  143.  
  144.  
  145.  
  146. local player = game.Players.LocalPlayer
  147. local char = player.Character
  148. local mouse = player:GetMouse()
  149. local larm = char["Left Arm"]
  150. local rarm = char["Right Arm"]
  151. local lleg = char["Left Leg"]
  152. local rleg = char["Right Leg"]
  153. local hed = char.Head
  154. local torso = char.Torso
  155. local ASD = BrickColor.new("Pastel brown")
  156. local hum = char.Humanoid
  157. local cam = game.Workspace.CurrentCamera
  158. local root = char.HumanoidRootPart
  159. local deb = false
  160. local shot = 0
  161. local l = game:GetService("Lighting")
  162. local rs = game:GetService("RunService").RenderStepped
  163. local stanceToggle = "Normal"
  164.  
  165. function tag()
  166. local cool = Instance.new("BillboardGui")
  167. cool.Parent = player.Character.Head
  168. cool.Size = UDim2.new(3, 0,3, 0)
  169. cool.Name = "cool"
  170. cool.MaxDistance = 150
  171. cool.StudsOffset = Vector3.new(0,4,0)
  172. local text = Instance.new("TextLabel")
  173. text.Parent = player.Character.Head.cool
  174. text.Text = "SCRIPT MADE BY MASONSTEINMET (W.I.P lol)"
  175. text.Font = "Cartoon"
  176. text.TextStrokeTransparency = 0
  177. text.TextStrokeColor3 = Color3.new(255, 255, 255)
  178. text.Size = UDim2.new(1,0,1,0)
  179. text.BackgroundTransparency = 1
  180. text.TextScaled = true
  181. player.Character.Humanoid.BreakJointsOnDeath = false
  182. player.Character.Humanoid.DisplayDistanceType = "None"
  183. end
  184.  
  185. function headMesh()
  186. player.Character.Head.Mesh.MeshType = "Brick"
  187. player.Character.Head.Mesh.Scale = Vector3.new(0.7, 1.25, 1.25)
  188. player.Character.Head.Mesh.Offset = Vector3.new(0, 0.125, 0)
  189. player.Character.Head.Material = Enum.Material.SmoothPlastic
  190. player.Character.Head.face.Texture = "rbxassetid://3528788"
  191. local face = Instance.new("Decal")
  192. face.Name = "eye"
  193. face.Parent = player.Character.Head
  194. face.Texture = "rbxassetid://257915800"
  195. while wait() do
  196. player.Character.Head.face.Texture = "rbxassetid://3528788"
  197. wait(7)
  198. player.Character.Head.face.Texture = "rbxassetid://211187842"
  199. wait(0.5)
  200. end
  201. end
  202.  
  203. function flatbody()
  204. local a = Instance.new("BlockMesh")
  205. a.Parent = larm
  206. larm.Material = Enum.Material.SmoothPlastic
  207. local b = Instance.new("BlockMesh")
  208. b.Parent = rarm
  209. rarm.Material = Enum.Material.SmoothPlastic
  210. local c = Instance.new("BlockMesh")
  211. c.Parent = lleg
  212. lleg.Material = Enum.Material.SmoothPlastic
  213. local d = Instance.new("BlockMesh")
  214. d.Parent = rleg
  215. rleg.Material = Enum.Material.SmoothPlastic
  216. local e = Instance.new("BlockMesh")
  217. e.Parent = player.Character.Torso
  218. e.Scale = Vector3.new(1,0.97,1)
  219. player.Character.Torso.Material = Enum.Material.SmoothPlastic
  220. end
  221.  
  222.  
  223.  
  224. function hat()
  225. local m = Instance.new("Part")
  226. m.Name = "Hat"
  227. m.Parent = player.Character.Head
  228. m.Position = player.Character.Head.Position
  229. m.Orientation = Vector3.new(0,180,0)
  230. m.BrickColor = BrickColor.new("Electric blue")
  231. local weld = Instance.new("Weld")
  232. weld.Parent = player.Character.Torso
  233. weld.Part0 = player.Character.Head
  234. weld.Part1 = player.Character.Head.Hat
  235. weld.C0 = CFrame.new(0, 0.8, -0.2) *CFrame.Angles(0, math.rad(180), 0)
  236. local mesh = Instance.new("FileMesh")
  237. mesh.Parent = player.Character.Head.Hat
  238. mesh.MeshId = "rbxassetid://3669929055"
  239. mesh.Scale = Vector3.new(1.04,1.04,1.04)
  240. end
  241.  
  242.  
  243. function value()
  244. local v = Instance.new("BoolValue")
  245. v.Parent = player.Character
  246. v.Name = "Bomb"
  247. v.Value = true
  248. end
  249. function explosion()
  250. local a = Instance.new("Part")
  251. a.Parent = workspace
  252. a.Name = "explode"
  253. a.Position = player.Character.Torso.Position
  254. a.Transparency = 1
  255. a.Anchored = true
  256. local b = Instance.new("ParticleEmitter")
  257. b.Parent = workspace.explode
  258. b.Enabled = true
  259. b.Texture = "rbxassetid://1946917526"
  260. b.Color = ColorSequence.new(Color3.fromRGB(255,140,0))
  261. b.Lifetime = NumberRange.new(3)
  262. b.Rate = 35
  263. b.RotSpeed = NumberRange.new(30)
  264. b.Speed = NumberRange.new(5, 5)
  265. b.SpreadAngle = Vector2.new(100,100)
  266. b.Size = NumberSequence.new(7)
  267. b.LightEmission = 0.55
  268. b.Transparency = NumberSequence.new(0.7)
  269. local sound = Instance.new("Sound")
  270. sound.Parent = workspace.explode
  271. sound.SoundId = "rbxassetid://2648563122"
  272. sound.Volume = 0.5
  273. sound.PlaybackSpeed = 1.5
  274. sound:Play()
  275. wait(4)
  276. a:Destroy()
  277. end
  278.  
  279. function grenadeexplode()
  280. local t = Instance.new("Part")
  281. t.Parent = workspace
  282. t.Name = "explode"
  283. t.Position = workspace.Grenade.Position
  284. t.Transparency = 1
  285. t.Anchored = true
  286. local y = Instance.new("ParticleEmitter")
  287. y.Parent = workspace.explode
  288. y.Enabled = true
  289. y.Texture = "rbxassetid://1946917526"
  290. y.Color = ColorSequence.new(Color3.fromRGB(255,140,0))
  291. y.Lifetime = NumberRange.new(3)
  292. y.Rate = 35
  293. y.RotSpeed = NumberRange.new(30)
  294. y.Speed = NumberRange.new(5, 5)
  295. y.SpreadAngle = Vector2.new(100,100)
  296. y.Size = NumberSequence.new(7)
  297. y.LightEmission = 0.55
  298. y.Transparency = NumberSequence.new(0.7)
  299. local sound = Instance.new("Sound")
  300. sound.Parent = workspace.explode
  301. sound.SoundId = "rbxassetid://2648563122"
  302. sound.Volume = 0.5
  303. sound.PlaybackSpeed = 1.5
  304. sound:Play()
  305. delay(8,function()
  306. t:Destroy()
  307. end)
  308. end
  309.  
  310. local UIS = game:GetService("UserInputService")
  311.  
  312. mouse.KeyDown:Connect(function(key)
  313. if key == "b" then
  314. wait(2)
  315. local a = Instance.new("Part")
  316. a.Parent = workspace
  317. a.Position = player.Character.Head.Position + (player.Character.Head.CFrame.lookVector * 4)
  318. a.Name = "Grenade"
  319. a.Size = Vector3.new(1.27, 1, 1.38)
  320. a.Transparency = 0
  321. local b = Instance.new("BodyForce")
  322. b.Parent = a
  323. b.Force = player.Character.Head.CFrame.lookVector * 80 + Vector3.new(0,225,0)
  324. a.CanCollide = true
  325. wait(.4)
  326. b:Destroy()
  327. wait(0.8)
  328. a.Transparency = 1
  329. a.Anchored = true
  330. local t = Instance.new("Part")
  331. t.Parent = workspace
  332. t.Name = "explode"
  333. t.Position = a.Position
  334. t.Transparency = 1
  335. t.Anchored = true
  336. local y = Instance.new("ParticleEmitter")
  337. y.Parent = workspace.explode
  338. y.Enabled = true
  339. y.Texture = "rbxassetid://1946917526"
  340. y.Color = ColorSequence.new(Color3.fromRGB(255,140,0))
  341. y.Lifetime = NumberRange.new(3)
  342. y.Rate = 35
  343. y.RotSpeed = NumberRange.new(30)
  344. y.Speed = NumberRange.new(8, 8)
  345. y.SpreadAngle = Vector2.new(100,100)
  346. y.Size = NumberSequence.new(7)
  347. y.LightEmission = 0.55
  348. y.Transparency = NumberSequence.new(0.7)
  349. local sound = Instance.new("Sound")
  350. sound.Parent = player.Character.Torso
  351. sound.SoundId = "rbxassetid://2648563122"
  352. sound.Volume = 0.5
  353. sound.PlaybackSpeed = 1.5
  354. sound:Play()
  355. delay(1,function()
  356. t:Destroy()
  357. a:Destroy()
  358. end)
  359. end
  360. end)
  361. value()
  362. hat()
  363. tag()
  364. flatbody()
  365. headMesh()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement