sIendytubble

hahah pony lmao

Jun 18th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. -- one of the most weirdest scripts i ever made
  2. -- AND NO, i am not a brony. i made this script for fun to annoy pplz
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. print("FE Compatibility code by Mokiros")
  8. local rp = RealPlayer
  9. script.Parent = rp.Character
  10.  
  11. --RemoteEvent for communicating
  12. local Event = Instance.new("RemoteEvent")
  13. Event.Name = "UserInput_Event"
  14.  
  15. --Fake event to make stuff like Mouse.KeyDown work
  16. local function fakeEvent()
  17. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  18. t.connect = t.Connect
  19. return t
  20. end
  21.  
  22. --Creating fake input objects with fake variables
  23. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  24. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  25. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  26. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  27. end}
  28. --Merged 2 functions into one by checking amount of arguments
  29. CAS.UnbindAction = CAS.BindAction
  30.  
  31. --This function will trigger the events that have been :Connect()'ed
  32. local function te(self,ev,...)
  33. local t = m[ev]
  34. if t and t._fakeEvent then
  35. for _,f in pairs(t.Functions) do
  36. f(...)
  37. end
  38. end
  39. end
  40. m.TrigEvent = te
  41. UIS.TrigEvent = te
  42.  
  43. Event.OnServerEvent:Connect(function(plr,io)
  44. if plr~=rp then return end
  45. m.Target = io.Target
  46. m.Hit = io.Hit
  47. if not io.isMouse then
  48. local b = io.UserInputState == Enum.UserInputState.Begin
  49. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  50. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  51. end
  52. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  53. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  54. end
  55. for _,t in pairs(CAS.Actions) do
  56. for _,k in pairs(t.Keys) do
  57. if k==io.KeyCode then
  58. t.Function(t.Name,io.UserInputState,io)
  59. end
  60. end
  61. end
  62. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  63. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  64. end
  65. end)
  66. Event.Parent = NLS([==[
  67. local Player = game:GetService("Players").LocalPlayer
  68. local Event = script:WaitForChild("UserInput_Event")
  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. local h,t
  79. --Give the server mouse data 30 times every second, but only if the values changed
  80. --If player is not moving their mouse, client won't fire events
  81. while wait(1/30) do
  82. if h~=Mouse.Hit or t~=Mouse.Target then
  83. h,t=Mouse.Hit,Mouse.Target
  84. Event:FireServer({isMouse=true,Target=t,Hit=h})
  85. end
  86. end]==],Player.Character)
  87.  
  88. ----Sandboxed game object that allows the usage of client-side methods and services
  89. --Real game object
  90. local _rg = game
  91.  
  92. --Metatable for fake service
  93. local fsmt = {
  94. __index = function(self,k)
  95. local s = rawget(self,"_RealService")
  96. if s then
  97. return typeof(s[k])=="function"
  98. and function(_,...)return s[k](s,...)end or s[k]
  99. end
  100. end,
  101. __newindex = function(self,k,v)
  102. local s = rawget(self,"_RealService")
  103. if s then s[k]=v end
  104. end
  105. }
  106. local function FakeService(t,RealService)
  107. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  108. return setmetatable(t,fsmt)
  109. end
  110.  
  111. --Fake game object
  112. local g = {
  113. GetService = function(self,s)
  114. return rawget(self,s) or _rg:GetService(s)
  115. end,
  116. Players = FakeService({
  117. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  118. },"Players"),
  119. UserInputService = FakeService(UIS,"UserInputService"),
  120. ContextActionService = FakeService(CAS,"ContextActionService"),
  121. RunService = FakeService({
  122. _btrs = {},
  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. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  133. g.service = g.GetService
  134. FakeService(g,game)
  135. --Changing owner to fake player object to support owner:GetMouse()
  136. game,owner = g,g.Players.LocalPlayer
  137. end
  138. mouse = owner:GetMouse()
  139. --child = :FindFirstChildOfClass()
  140. mouse.Button1Down:Connect(function()
  141. tar = mouse.Target
  142. if tar.Parent:FindFirstChildOfClass("Humanoid") and tar.Parent:FindFirstChild("HumanoidRootPart") then
  143. hahapony = tar.Parent
  144. mas = tar.Parent.HumanoidRootPart
  145. BillboardGui0 = Instance.new("BillboardGui")
  146. ImageLabel1 = Instance.new("ImageLabel")
  147. BillboardGui0.Name = "pony"
  148. BillboardGui0.Parent = mas
  149. BillboardGui0.LightInfluence = 1
  150. BillboardGui0.Size = UDim2.new(6, 0, 6, 0)
  151. BillboardGui0.Active = true
  152. BillboardGui0.ClipsDescendants = true
  153. BillboardGui0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  154. ImageLabel1.Parent = BillboardGui0
  155. ImageLabel1.Size = UDim2.new(1, 0, 1, 0)
  156. ImageLabel1.BackgroundColor = BrickColor.new("Institutional white")
  157. ImageLabel1.BackgroundColor3 = Color3.new(1, 1, 1)
  158. ImageLabel1.BackgroundTransparency = 1
  159. ImageLabel1.Image = "rbxassetid://250440637"
  160. for i,v in pairs(hahapony:GetDescendants()) do
  161. if v.ClassName == "Part" or v.ClassName == "MeshPart" or v.ClassName == "Texture" or v.ClassName == "Decal" then
  162. v.Transparency = 1
  163. end
  164. end
  165. end
  166. end)
Add Comment
Please, Sign In to add comment