Advertisement
samuelrichter66

green light ride

May 23rd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.54 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152.  
  153.  
  154. -- Objects
  155. MIDI = Instance.new("ScreenGui")
  156. Frame = Instance.new("Frame")
  157. ID = Instance.new("TextBox")
  158. Play = Instance.new("TextButton")
  159. Dark = Instance.new("TextButton")
  160. Bright = Instance.new("TextButton")
  161. Stop = Instance.new("TextButton")
  162. Hide = Instance.new("TextButton")
  163. Set = Instance.new("TextButton")
  164. BColor = Instance.new("TextBox")
  165. Random = Instance.new("TextButton")
  166. Material = Instance.new("TextBox")
  167. Trans = Instance.new("TextBox")
  168. sound = Instance.new("Sound",game.Players.LocalPlayer.Character.Torso)
  169. sound.Volume = 4
  170. sound.Looped = true
  171. BVal = "Deep orange"
  172. MVal = "Neon"
  173. TVal = 0
  174. Active = false
  175.  
  176. -- Properties
  177.  
  178. MIDI.Name = "MIDI"
  179. MIDI.Parent = game.Players.LocalPlayer.PlayerGui
  180.  
  181. Frame.Parent = MIDI
  182. Frame.Active = true
  183. Frame.BackgroundColor3 = Color3.new(0, 0, 0)
  184. Frame.BackgroundTransparency = 0.5799999833107
  185. Frame.BorderSizePixel = 0
  186. Frame.Draggable = true
  187. Frame.Position = UDim2.new(0, 300, 0, 50)
  188. Frame.Size = UDim2.new(0, 310, 0, 200)
  189.  
  190. ID.Name = "ID"
  191. ID.Parent = Frame
  192. ID.BackgroundColor3 = Color3.new(1, 1, 1)
  193. ID.BorderSizePixel = 0
  194. ID.Position = UDim2.new(0, 100, 0, 10)
  195. ID.Size = UDim2.new(0, 120, 0, 30)
  196. ID.Font = Enum.Font.Arcade
  197. ID.FontSize = Enum.FontSize.Size18
  198. ID.Text = "639837244"
  199. ID.TextColor3 = Color3.new(0, 0, 0)
  200. ID.TextSize = 18
  201.  
  202. Material.Name = "Material"
  203. Material.Parent = Frame
  204. Material.BackgroundColor3 = Color3.new(1, 1, 1)
  205. Material.BorderSizePixel = 0
  206. Material.Position = UDim2.new(0, 210, 0, 95)
  207. Material.Size = UDim2.new(0, 90, 0, 15)
  208. Material.Font = Enum.Font.Arcade
  209. Material.FontSize = Enum.FontSize.Size14
  210. Material.Text = "Neon"
  211. Material.TextSize = 14
  212.  
  213. Trans.Name = "Trans"
  214. Trans.Parent = Frame
  215. Trans.BackgroundColor3 = Color3.new(1, 1, 1)
  216. Trans.BorderSizePixel = 0
  217. Trans.Position = UDim2.new(0, 210, 0, 75)
  218. Trans.Size = UDim2.new(0, 90, 0, 15)
  219. Trans.Font = Enum.Font.Arcade
  220. Trans.FontSize = Enum.FontSize.Size14
  221. Trans.Text = "Transparency"
  222. Trans.TextSize = 14
  223.  
  224. Set.Name = "Set"
  225. Set.Parent = Frame
  226. Set.BackgroundColor3 = Color3.new(1, 1, 1)
  227. Set.BorderSizePixel = 0
  228. Set.Position = UDim2.new(0, 210, 0, 135)
  229. Set.Size = UDim2.new(0, 90, 0, 15)
  230. Set.Font = Enum.Font.Arcade
  231. Set.FontSize = Enum.FontSize.Size14
  232. Set.Text = "Set"
  233. Set.TextSize = 14
  234. Set.MouseButton1Down:connect(function()
  235. if Active == true then
  236. Active = false
  237. end
  238. BVal = tostring(BColor.Text)
  239. TVal = tonumber(Trans.Text)
  240. MVal = tostring(Material.Text)
  241. end)
  242.  
  243. BColor.Name = "BColor"
  244. BColor.Parent = Frame
  245. BColor.BackgroundColor3 = Color3.new(1, 1, 1)
  246. BColor.BorderSizePixel = 0
  247. BColor.Position = UDim2.new(0, 210, 0, 115)
  248. BColor.Size = UDim2.new(0, 90, 0, 15)
  249. BColor.Font = Enum.Font.Arcade
  250. BColor.FontSize = Enum.FontSize.Size14
  251. BColor.Text = "Lime Green"
  252. BColor.TextSize = 14
  253.  
  254. Random.Name = "Random"
  255. Random.Parent = Frame
  256. Random.BackgroundColor3 = Color3.new(1, 1, 1)
  257. Random.BorderSizePixel = 0
  258. Random.Position = UDim2.new(0, 10, 0, 80)
  259. Random.Size = UDim2.new(0, 90, 0, 30)
  260. Random.Font = Enum.Font.Arcade
  261. Random.FontSize = Enum.FontSize.Size14
  262. Random.Text = "Random"
  263. Random.TextSize = 14
  264. Random.MouseButton1Down:connect(function()
  265. if Active == false then
  266. Active = true
  267. end
  268. end)
  269.  
  270. Play.Name = "Play"
  271. Play.Parent = Frame
  272. Play.BackgroundColor3 = Color3.new(1, 1, 1)
  273. Play.BorderSizePixel = 0
  274. Play.Position = UDim2.new(0, 10, 0, 160)
  275. Play.Size = UDim2.new(0, 90, 0, 30)
  276. Play.Font = Enum.Font.Arcade
  277. Play.FontSize = Enum.FontSize.Size14
  278. Play.Text = "Play"
  279. Play.TextSize = 14
  280. Play.MouseButton1Down:connect(function()
  281. sound.TimePosition = 0
  282. sound.Playing = true
  283. sound.SoundId = "rbxassetid://"..tonumber(ID.Text)
  284. end)
  285.  
  286. Dark.Name = "Dark"
  287. Dark.Parent = Frame
  288. Dark.BackgroundColor3 = Color3.new(1, 1, 1)
  289. Dark.BorderSizePixel = 0
  290. Dark.Position = UDim2.new(0, 10, 0, 120)
  291. Dark.Size = UDim2.new(0, 90, 0, 30)
  292. Dark.Font = Enum.Font.Arcade
  293. Dark.FontSize = Enum.FontSize.Size14
  294. Dark.Text = "Dark"
  295. Dark.TextSize = 14
  296. Dark.MouseButton1Down:connect(function()
  297. game.Lighting.TimeOfDay = 0
  298. game.Lighting.GlobalShadows = false
  299. game.Lighting.Ambient = Color3.new(0,0,0)
  300. game.Lighting.Brightness = 0
  301. end)
  302.  
  303. Bright.Name = "Bright"
  304. Bright.Parent = Frame
  305. Bright.BackgroundColor3 = Color3.new(1, 1, 1)
  306. Bright.BorderSizePixel = 0
  307. Bright.Position = UDim2.new(0, 110, 0, 120)
  308. Bright.Size = UDim2.new(0, 90, 0, 30)
  309. Bright.Font = Enum.Font.Arcade
  310. Bright.FontSize = Enum.FontSize.Size14
  311. Bright.Text = "Bright"
  312. Bright.TextSize = 14
  313. Bright.MouseButton1Down:connect(function()
  314. game.Lighting.TimeOfDay = 12
  315. game.Lighting.GlobalShadows = true
  316. game.Lighting.Ambient = Color3.fromRGB(10,10,10)
  317. game.Lighting.Brightness = 1
  318. end)
  319.  
  320. Stop.Name = "Stop"
  321. Stop.Parent = Frame
  322. Stop.BackgroundColor3 = Color3.new(1, 1, 1)
  323. Stop.BorderSizePixel = 0
  324. Stop.Position = UDim2.new(0, 110, 0, 160)
  325. Stop.Size = UDim2.new(0, 90, 0, 30)
  326. Stop.Font = Enum.Font.Arcade
  327. Stop.FontSize = Enum.FontSize.Size14
  328. Stop.Text = "Stop"
  329. Stop.TextSize = 14
  330. Stop.MouseButton1Down:connect(function()
  331. sound.Playing = false
  332. end)
  333.  
  334. Hide.Name = "Hide"
  335. Hide.Parent = Frame
  336. Hide.BackgroundColor3 = Color3.new(1, 1, 1)
  337. Hide.BorderSizePixel = 0
  338. Hide.Position = UDim2.new(0, 210, 0, 160)
  339. Hide.Size = UDim2.new(0, 90, 0, 30)
  340. Hide.Font = Enum.Font.Arcade
  341. Hide.FontSize = Enum.FontSize.Size14
  342. Hide.Text = "Clear"
  343. Hide.TextSize = 14
  344. Hide.MouseButton1Down:connect(function()
  345. for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  346. if v.Name == "location" then
  347. v:Remove()
  348. end
  349. end
  350. end)
  351.  
  352. --- Made By Pugz AKA (PugLover77)
  353. plyr = game.Players.LocalPlayer
  354. c = plyr.Character
  355. RunService = game:service'RunService'
  356. mouse = game.Players.LocalPlayer:GetMouse()
  357. local draw2 = false
  358. local colorA = 1
  359. local lastPos
  360.  
  361. tool = Instance.new("HopperBin", plyr.Backpack)
  362. tool.Name = "Draw"
  363.  
  364.  
  365.  
  366. mouse = plyr:GetMouse()
  367.  
  368.  
  369. function draw(obj) --
  370. local lastPos = obj.CFrame.p
  371. coroutine.wrap(function()
  372. while wait() do
  373. if draw2 then
  374. while draw2 do
  375. wait()
  376. objC = obj:Clone()
  377. objC.Parent = c
  378. objC.Anchored = true
  379. local distance = (lastPos- obj.CFrame.p).magnitude
  380. objC.Size = Vector3.new(.1,.1,distance)
  381. objC.CFrame = CFrame.new(lastPos,obj.Position)*CFrame.new(0,0,-distance/2)
  382. lastPos = obj.CFrame.p
  383. end
  384. else
  385. break
  386. end
  387. end
  388. end)()
  389. end
  390.  
  391. tool.Selected:connect(function(mouse)
  392.  
  393. mouse.Button1Down:connect(function(mouse)
  394. draw2 = true
  395. part = Instance.new("Part", c)
  396. mesh = Instance.new("BlockMesh",part)
  397. Li = Instance.new("PointLight",part)
  398. Li.Range = 8
  399. Li.Color = part.Color
  400. part.Name = "location"
  401.  
  402. part.BottomSurface = 0
  403. part.Material = MVal
  404. part.TopSurface = 0
  405. part.Size = Vector3.new()
  406. part.Transparency = TVal
  407. if Active == true then
  408. part.Color = Color3.new(math.random(), math.random(), math.random())
  409. elseif Active == false then
  410. part.BrickColor = BrickColor.new(BVal)
  411. end
  412. Li.Color = part.Color
  413. part.FormFactor = "Custom"
  414. part.Size = Vector3.new(0.01, 0.01, 0.01)
  415. part.Anchored = true
  416. part.Locked = true
  417. coroutine.wrap(function()
  418. while part ~= nil do
  419. part.CFrame = CFrame.new(plyr:GetMouse().Hit.p.x,plyr:GetMouse().Hit.p.y,plyr:GetMouse().Hit.p.z)
  420. wait()
  421. end
  422. end)()
  423. wait()
  424. draw(part)
  425. wait()
  426. end)
  427. mouse.Button1Up:connect(function(mouse)
  428. draw2 = false
  429.  
  430. end)
  431.  
  432. end)
  433. x = 60
  434. game:GetService("RunService").Stepped:connect(function()
  435. n = sound.PlaybackLoudness
  436. if n > 500 then
  437. x = 100
  438. elseif n < 500 then
  439. x = 110
  440. end
  441. for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  442. if v.Name == "location" then
  443. v.Mesh.Scale = Vector3.new(n / x, n / x, n / x)
  444. v.PointLight.Range = n / 50
  445. end
  446. end
  447. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement