Advertisement
DaOMEGAa32

puckman

Oct 13th, 2019
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.17 KB | None | 0 0
  1. --(---------PLEASE NO LEAK OR PACMAN WELL EAT U----------)
  2. --(---------made by zeddikuss123-------------------------)
  3. --(---------i dont own nintendo--------------------------)
  4. --(---------pacman script--------------------------------)
  5. --https://github.com/Mokiros/roblox-FE-compatibility
  6. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  7. local Player,game,owner = owner,game
  8. local RealPlayer = Player
  9. do
  10. print("FE Compatibility code V2 by Mokiros")
  11. local RealPlayer = RealPlayer
  12. script.Parent = RealPlayer.Character
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local Disconnect_Function = function(this)
  16. this[1].Functions[this[2]] = nil
  17. end
  18. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  19. local FakeEvent_Metatable = {__index={
  20. Connect = function(this,f)
  21. local i = tostring(math.random(0,10000))
  22. while this.Functions[i] do
  23. i = tostring(math.random(0,10000))
  24. end
  25. this.Functions[i] = f
  26. return setmetatable({this,i},Disconnect_Metatable)
  27. end
  28. }}
  29. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  30. local function fakeEvent()
  31. return setmetatable({Functions={}},FakeEvent_Metatable)
  32. end
  33.  
  34. --Creating fake input objects with fake variables
  35. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  36. FakeMouse.keyUp = FakeMouse.KeyUp
  37. FakeMouse.keyDown = FakeMouse.KeyDown
  38. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  39. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  40. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  41. end}
  42. --Merged 2 functions into one by checking amount of arguments
  43. CAS.UnbindAction = CAS.BindAction
  44.  
  45. --This function will trigger the events that have been :Connect()'ed
  46. local function TriggerEvent(self,ev,...)
  47. for _,f in pairs(self[ev].Functions) do
  48. f(...)
  49. end
  50. end
  51. FakeMouse.TriggerEvent = TriggerEvent
  52. UIS.TriggerEvent = TriggerEvent
  53.  
  54. --Client communication
  55. local Event = Instance.new("RemoteEvent")
  56. Event.Name = "UserInput_Event"
  57. Event.OnServerEvent:Connect(function(plr,io)
  58. if plr~=RealPlayer then return end
  59. FakeMouse.Target = io.Target
  60. FakeMouse.Hit = io.Hit
  61. if not io.isMouse then
  62. local b = io.UserInputState == Enum.UserInputState.Begin
  63. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  64. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  65. end
  66. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  67. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  68. end
  69. for _,t in pairs(CAS.Actions) do
  70. for _,k in pairs(t.Keys) do
  71. if k==io.KeyCode then
  72. t.Function(t.Name,io.UserInputState,io)
  73. end
  74. end
  75. end
  76. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  77. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  78. end
  79. end)
  80. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  81. local Mouse = owner:GetMouse()
  82. local UIS = game:GetService("UserInputService")
  83. local input = function(io,RobloxHandled)
  84. if RobloxHandled then return end
  85. --Since InputObject is a client-side instance, we create and pass table instead
  86. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  87. end
  88. UIS.InputBegan:Connect(input)
  89. UIS.InputEnded:Connect(input)
  90.  
  91. local h,t
  92. --Give the server mouse data every second frame, but only if the values changed
  93. --If player is not moving their mouse, client won't fire events
  94. local HB = game:GetService("RunService").Heartbeat
  95. while true do
  96. if h~=Mouse.Hit or t~=Mouse.Target then
  97. h,t=Mouse.Hit,Mouse.Target
  98. Event:FireServer({isMouse=true,Target=t,Hit=h})
  99. end
  100. --Wait 2 frames
  101. for i=1,2 do
  102. HB:Wait()
  103. end
  104. end]==],script)
  105.  
  106. ----Sandboxed game object that allows the usage of client-side methods and services
  107. --Real game object
  108. local RealGame = game
  109.  
  110. --Metatable for fake service
  111. local FakeService_Metatable = {
  112. __index = function(self,k)
  113. local s = rawget(self,"_RealService")
  114. if s then
  115. return typeof(s[k])=="function"
  116. and function(_,...)return s[k](s,...)end or s[k]
  117. end
  118. end,
  119. __newindex = function(self,k,v)
  120. local s = rawget(self,"_RealService")
  121. if s then s[k]=v end
  122. end
  123. }
  124. local function FakeService(t,RealService)
  125. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  126. return setmetatable(t,FakeService_Metatable)
  127. end
  128.  
  129. --Fake game object
  130. local FakeGame = {
  131. GetService = function(self,s)
  132. return rawget(self,s) or RealGame:GetService(s)
  133. end,
  134. Players = FakeService({
  135. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  136. },"Players"),
  137. UserInputService = FakeService(UIS,"UserInputService"),
  138. ContextActionService = FakeService(CAS,"ContextActionService"),
  139. RunService = FakeService({
  140. _btrs = {},
  141. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  142. BindToRenderStep = function(self,name,_,fun)
  143. self._btrs[name] = self.Heartbeat:Connect(fun)
  144. end,
  145. UnbindFromRenderStep = function(self,name)
  146. self._btrs[name]:Disconnect()
  147. end,
  148. },"RunService")
  149. }
  150. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  151. FakeGame.service = FakeGame.GetService
  152. FakeService(FakeGame,game)
  153. --Changing owner to fake player object to support owner:GetMouse()
  154. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  155. end
  156.  
  157. print ("OH CRAP HERE COMES PACMAN!")
  158. warn ("made by zeddikuss123")
  159. print ("please no leak...")
  160. print ("lets hope skids dont touch this")
  161. print ("sorry if it face the other way. is still rushed xdddddd")
  162. wait (1)
  163. print ("loading.")
  164. wait (0.3)
  165. print ("loading..")
  166. wait (0.3)
  167. print ("loading...")
  168. wait (0.3)
  169. print ("loading.")
  170. wait (0.3)
  171. print ("loading..")
  172. wait (0.3)
  173. print ("loading...")
  174. wait (0.3)
  175. print ("loading.")
  176. wait (0.3)
  177. print ("loading..")
  178. wait (0.3)
  179. print ("loading...")
  180. wait (0.3)
  181. print ("loading.")
  182. wait (0.3)
  183. print ("loading..")
  184. wait (0.3)
  185. print ("loading...")
  186. wait (0.3)
  187. print ("loading.")
  188. wait (0.3)
  189. print ("loading..")
  190. wait (0.3)
  191. print ("loading...")
  192. wait (0.3)
  193. print ("GAME ON!")
  194. local s = Instance.new("Sound")
  195.  
  196. s.Name = "Name"
  197. s.SoundId = "rbxassetid://182129114"
  198. s.Volume = 5
  199. s.Looped = true
  200. s.archivable = false
  201.  
  202. s.Parent = game.Workspace
  203.  
  204. wait(0.2)
  205.  
  206. s:play()
  207. local pchar = game.Players.LocalPlayer.Character
  208. local duck = Instance.new("SpecialMesh", pchar.Torso)
  209. duck.MeshType = "FileMesh"
  210. duck.MeshId = "rbxassetid://749622108"
  211. duck.TextureId = "rbxassetid://749622167"
  212. duck.Scale = Vector3.new(5, 5, 5)
  213. pchar.Head.Transparency = 1
  214. pchar["Left Arm"].Transparency = 1
  215. pchar["Right Arm"].Transparency = 1
  216. pchar["Left Leg"].Transparency = 1
  217. pchar["Right Leg"].Transparency = 1
  218. CV="White"
  219.  
  220. p = game.Players.LocalPlayer
  221. char = p.Character
  222. local txt = Instance.new("BillboardGui", char)
  223. txt.Adornee = char .Head
  224. txt.Name = "_status"
  225. txt.Size = UDim2.new(2, 0, 1.2, 0)
  226. txt.StudsOffset = Vector3.new(-9, 8, 0)
  227. local text = Instance.new("TextLabel", txt)
  228. text.Size = UDim2.new(10, 0, 7, 0)
  229. text.FontSize = "Size24"
  230. text.TextScaled = true
  231. text.TextTransparency = 0
  232. text.BackgroundTransparency = 1
  233. text.TextTransparency = 0
  234. text.TextStrokeTransparency = 1
  235. text.Font = "Code"
  236. text.TextStrokeColor3 = Color3.fromRGB(255, 255, 0)
  237.  
  238. v=Instance.new("Part")
  239. v.Name = "ColorBrick"
  240. v.Parent=p.Character
  241. v.FormFactor="Symmetric"
  242. v.Anchored=true
  243. v.CanCollide=false
  244. v.BottomSurface="Smooth"
  245. v.TopSurface="Smooth"
  246. v.Size=Vector3.new(10,5,3)
  247. v.Transparency=1
  248. v.CFrame=char.Torso.CFrame
  249. v.BrickColor=BrickColor.new(CV)
  250. v.Transparency=1
  251. text.TextColor3 = Color3.fromRGB(255, 255, 0)
  252. v.Shape="Block"
  253. text.Text = "oh heck. here comes pacman."
  254. lp = game.Players.LocalPlayer
  255.  
  256. lp.Character.Torso.Touched:connect(function(touch)
  257. if touch:IsA("Part") then
  258. touch.Anchored = false
  259. touch:BreakJoints()
  260. end
  261. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement