Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- --Draw something, put your sound id in, and watch the light show!--
- --Enjoy lads.--
- Player=game:GetService("Players").LocalPlayer
- Character=Player.Character
- Character.Humanoid.Name = "noneofurbusiness"
- hum = Character.noneofurbusiness
- LeftArm=Character["Left Arm"]
- LeftLeg=Character["Left Leg"]
- RightArm=Character["Right Arm"]
- RightLeg=Character["Right Leg"]
- Root=Character["HumanoidRootPart"]
- Head=Character["Head"]
- Torso=Character["Torso"]
- Neck=Torso["Neck"]
- mouse = Player:GetMouse()
- removeuseless = game:GetService("Debris")
- soundIsPlaying = false
- number = 0
- stop = false
- flatt = false
- standingg = true
- tf = 0
- idrewsomething = false
- tab2={}
- tab={}
- blue = false
- red = true
- green = false
- drawingallowed = true
- MseGuide = true
- RunSrv = game:GetService("RunService")
- RenderStepped = game:GetService("RunService").RenderStepped
- local HEADLERP = Instance.new("ManualWeld")
- HEADLERP.Parent = Head
- HEADLERP.Part0 = Head
- HEADLERP.Part1 = Head
- HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
- OrgnC0 = Neck.C0
- local movelimbs = coroutine.wrap(function()
- while RunSrv.RenderStepped:wait() do
- TrsoLV = Torso.CFrame.lookVector
- Dist = nil
- Diff = nil
- if not MseGuide then
- print("l")
- else
- local _, Point = Workspace:FindPartOnRay(Ray.new(Head.CFrame.p, mouse.Hit.lookVector), Workspace, false, true)
- Dist = (Head.CFrame.p-Point).magnitude
- Diff = Head.CFrame.Y-Point.Y
- local _, Point2 = Workspace:FindPartOnRay(Ray.new(LeftArm.CFrame.p, mouse.Hit.lookVector), Workspace, false, true)
- Dist2 = (LeftArm.CFrame.p-Point).magnitude
- Diff2 = LeftArm.CFrame.Y-Point.Y
- HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
- Neck.C0 = Neck.C0:lerp(OrgnC0*CFrame.Angles((math.tan(Diff/Dist)*1), 0, (((Head.CFrame.p-Point).Unit):Cross(Torso.CFrame.lookVector)).Y*1), .1)
- end
- end
- end)
- movelimbs()
- godmode = coroutine.wrap(function()---- so you don't get killed by fucking random things
- while true do
- hum.MaxHealth = math.huge
- wait(0.0000001)
- hum.Health = math.huge
- wait()
- end
- end)
- godmode()
- ff = Instance.new("ForceField", Character)
- ff.Visible = false
- coroutine.wrap(function()
- mouse.Button1Down:connect(function()
- if drawingallowed then
- fo = false
- while true do
- if fo then break end
- idrewsomething = true
- brick = Instance.new("Part",Character)
- brick.Anchored = true
- brick.Material = "Neon"
- brick.CanCollide = false
- brick.BrickColor = BrickColor.new("Really black")
- brick.Size = Vector3.new(1,1,1)
- brick.CFrame = CFrame.new(mouse.Hit.p)
- table.insert(tab2,brick)
- light = Instance.new("PointLight", brick)
- light.Color = brick.BrickColor.Color
- light.Range = 0
- light.Enabled = true
- light.Shadows = true
- light.Brightness = 0
- table.insert(tab,light)
- wait()
- end
- end
- end)
- end)()
- coroutine.wrap(function()
- mouse.Button1Up:connect(function()
- if drawingallowed then
- fo = true
- end
- end)
- end)()
- ---GUI---
- screenGui = Instance.new("ScreenGui")
- screenGui.Parent = script.Parent
- frame = Instance.new("Frame")
- frame.Parent = screenGui
- frame.Position = UDim2.new(0, 8, 0, 225)
- frame.Size = UDim2.new(0, 250, 0, 200)
- frame.BackgroundColor3 = BrickColor.new("White").Color
- frame.BackgroundTransparency = .5
- textButton = Instance.new("TextButton")
- textButton.Parent = screenGui
- textButton.Position = UDim2.new(0, 12, 0, 400)
- textButton.Size = UDim2.new(0, 50, 0, 10)
- textButton.BackgroundColor3 = BrickColor.new("Really red").Color
- textButton.Text = "Red"
- textButton.MouseButton1Down:connect(function()
- red = true
- green = false
- blue = false
- rainbow = false
- smooth = false
- end)
- textButton2 = Instance.new("TextButton")
- textButton2.Parent = screenGui
- textButton2.Position = UDim2.new(0, 75, 0, 400)
- textButton2.Size = UDim2.new(0, 50, 0, 10)
- textButton2.BackgroundColor3 = BrickColor.new("Really blue").Color
- textButton2.Text = "Blue"
- textButton2.MouseButton1Down:connect(function()
- red = false
- green = false
- blue = true
- rainbow = false
- smooth = false
- end)
- textButton3 = Instance.new("TextButton")
- textButton3.Parent = screenGui
- textButton3.Position = UDim2.new(0, 138, 0, 400)
- textButton3.Size = UDim2.new(0, 50, 0, 10)
- textButton3.BackgroundColor3 = BrickColor.new("Lime green").Color
- textButton3.Text = "Green"
- textButton3.MouseButton1Down:connect(function()
- red = false
- green = true
- blue = false
- rainbow = false
- smooth = false
- end)
- textButton4 = Instance.new("TextButton")
- textButton4.Parent = screenGui
- textButton4.Position = UDim2.new(0, 201, 0, 400)
- textButton4.Size = UDim2.new(0, 50, 0, 10)
- coroutine.wrap(function()
- while true do
- textButton4.BackgroundColor3 = BrickColor.Random().Color
- wait(.05)
- end
- end)()
- textButton4.Text = "Rainbow"
- textButton4.MouseButton1Down:connect(function()
- red = false
- green = false
- blue = false
- rainbow = true
- smooth = false
- end)
- textBox = Instance.new("TextBox")
- textBox.Parent = screenGui
- textBox.Position = UDim2.new(0, 58, 0, 280)
- textBox.Size = UDim2.new(0, 150, 0, 20)
- textBox.BackgroundColor3 = BrickColor.new("White").Color
- textBox.Text = "Type Sound Id here"
- form = Instance.new("TextButton")
- form.Parent = screenGui
- form.TextScaled = true
- form.Position = UDim2.new(0, 114, 0, 305)
- form.Size = UDim2.new(0, 40, 0, 20)
- form.BackgroundColor3 = BrickColor.new("White").Color
- form.Text = "Up"
- form.MouseButton1Down:connect(function()
- if standingg then
- standingg = false
- flatt = true
- form.Text = "Flat"
- elseif flatt then
- flatt = false
- standingg = true
- form.Text = "Up"
- end
- end)
- coroutine.wrap(function()
- while wait() do
- sid = textBox.Text
- end
- end)()
- playbutton = Instance.new("TextButton")
- playbutton.Parent = screenGui
- playbutton.Position = UDim2.new(0, 58, 0, 305)
- playbutton.Size = UDim2.new(0, 50, 0, 20)
- playbutton.BackgroundColor3 = BrickColor.new("White").Color
- playbutton.Text = "Play"
- playbutton.MouseButton1Down:connect(function()
- if not idrewsomething then return end
- if soundIsPlaying then
- sound1:Remove()
- sound1 = Instance.new("Sound", Character)
- sound1.Looped = true
- sound1.SoundId = "http://www.roblox.com/asset/?id=" .. sid
- sound1:Play()
- else
- soundIsPlaying = true
- vol.Text = 1
- pitch.Text = 1
- sound1 = Instance.new("Sound", Character)
- coroutine.wrap(function()
- while soundIsPlaying do
- wait()
- sound1.Volume = svol
- end
- end)()
- sound1.Looped = true
- coroutine.wrap(function()
- while soundIsPlaying do
- sound1.Pitch = pitchh
- wait()
- end
- end)()
- sound1.SoundId = "http://www.roblox.com/asset/?id=" .. sid
- sound1:Play()
- coroutine.wrap(function()
- while sound1.IsPlaying and soundIsPlaying do
- for i,v in pairs(tab) do
- v.Enabled = true
- v.Brightness = sound1.PlaybackLoudness/19
- v.Range = sound1.PlaybackLoudness/15
- if red then
- v.Color = Color3.new(sound1.PlaybackLoudness/200, 0,0)
- elseif blue then
- v.Color = Color3.new(0, 0,sound1.PlaybackLoudness/200)
- elseif green then
- v.Color = Color3.new(0, sound1.PlaybackLoudness/200,0)
- elseif rainbow then
- v.Color = brick.BrickColor.Color
- end
- end
- wait()
- end
- end)()
- while sound1.IsPlaying and soundIsPlaying do
- workspace.CurrentCamera.FieldOfView = 70 - sound1.PlaybackLoudness/100
- bcol = brick.BrickColor
- for _,v in pairs(tab2) do
- if standingg then
- v.Size = Vector3.new(1, sound1.PlaybackLoudness/math.random(10,25), 1)
- elseif flatt then
- v.Size = Vector3.new(sound1.PlaybackLoudness/math.random(10,25), 1, 1)
- end
- if red then
- v.BrickColor = BrickColor.new(Color3.new(sound1.PlaybackLoudness/200, 0,0))
- elseif blue then
- v.BrickColor = BrickColor.new(Color3.new(0,0,sound1.PlaybackLoudness/200))
- elseif green then
- v.BrickColor = BrickColor.new(Color3.new(0,sound1.PlaybackLoudness/200,0))
- elseif rainbow then
- v.BrickColor = BrickColor.Random()
- end
- end
- wait()
- end
- end
- end)
- local stopbutton = Instance.new("TextButton")
- stopbutton.Parent = screenGui
- stopbutton.Position = UDim2.new(0, 158, 0, 305)
- stopbutton.Size = UDim2.new(0, 50, 0, 20)
- stopbutton.BackgroundColor3 = BrickColor.new("White").Color
- stopbutton.Text = "Stop"
- vol = Instance.new("TextBox")
- vol.Parent = screenGui
- vol.Position = UDim2.new(0, 58, 0, 330)
- vol.Size = UDim2.new(0, 50, 0, 20)
- vol.BackgroundColor3 = BrickColor.new("White").Color
- vol.Text = "Volume"
- coroutine.wrap(function()
- while wait() do
- svol = vol.Text
- end
- end)()
- local remove = Instance.new("TextButton")
- remove.Parent = screenGui
- remove.Position = UDim2.new(0, 108, 0, 370)
- remove.Size = UDim2.new(0, 50, 0, 20)
- remove.BackgroundColor3 = BrickColor.new("White").Color
- remove.Text = "Clean"
- pitch = Instance.new("TextBox")
- pitch.Parent = screenGui
- pitch.Position = UDim2.new(0, 158, 0, 330)
- pitch.Size = UDim2.new(0, 50, 0, 20)
- pitch.BackgroundColor3 = BrickColor.new("White").Color
- pitch.Text = "Pitch"
- coroutine.wrap(function()
- while wait() do
- pitchh = pitch.Text
- end
- end)()
- pitchup = Instance.new("ImageButton")
- pitchup.Parent = screenGui
- pitchup.Position = UDim2.new(0, 131, 0, 327)
- pitchup.BackgroundTransparency = 1
- pitchup.Size = UDim2.new(0, 25, 0, 25)
- pitchup.Image = "rbxassetid://29563813"
- pitchup.MouseButton1Down:connect(function()
- if soundIsPlaying then
- pitch.Text = pitch.Text + .1
- end
- end)
- pitchdown = Instance.new("ImageButton")
- pitchdown.Parent = screenGui
- pitchdown.Rotation = 180
- pitchdown.Position = UDim2.new(0, 211, 0, 327)
- pitchdown.BackgroundTransparency = 1
- pitchdown.Size = UDim2.new(0, 25, 0, 25)
- pitchdown.Image = "rbxassetid://29563813"
- pitchdown.MouseButton1Down:connect(function()
- if soundIsPlaying then
- pitch.Text = pitch.Text - .1
- end
- end)
- remove.MouseButton1Down:connect(function()
- if idrewsomething then
- if soundIsPlaying then
- soundIsPlaying = false
- workspace.CurrentCamera.FieldOfView = 70
- woosh = Instance.new("Sound",Character)
- woosh.Volume = 2
- woosh.SoundId = "rbxasstid://215402014"
- woosh:Play()
- sound1:Stop()
- pitch.Text = "Pitch"
- vol.Text = "Volume"
- removeuseless:AddItem(woosh,2)
- for _,v in pairs(tab2) do
- v:Remove()
- end
- idrewsomething = false
- elseif not soundIsPlaying then
- soundIsPlaying = false
- woosh = Instance.new("Sound",Character)
- woosh.Volume = 2
- woosh.SoundId = "rbxasstid://215402014"
- woosh:Play()
- for _,v in pairs(tab2) do
- v:Remove()
- end
- idrewsomething = false
- end
- end
- end)
- local day = Instance.new("TextButton")
- day.Parent = screenGui
- day.Position = UDim2.new(0, 50, 0, 370)
- day.Size = UDim2.new(0, 50, 0, 20)
- day.BackgroundColor3 = BrickColor.new("Bright yellow").Color
- day.Text = "Day"
- day.MouseButton1Down:connect(function()
- daytime = true
- nighttime = false
- turnon = Instance.new("Sound",Character)
- turnon.SoundId = "rbxassetid://858896518"
- turnon.Volume = 1
- turnon.Pitch = 1.05
- turnon:Play()
- removeuseless:AddItem(turnon,2)
- coroutine.wrap(function()
- while daytime do
- game.Lighting.TimeOfDay = 12
- game.Lighting.GlobalShadows = true
- game.Lighting.Ambient = Color3.fromRGB(10,10,10)
- game.Lighting.Brightness = 1
- wait()
- end
- end)()
- end)
- local night = Instance.new("TextButton")
- night.Parent = screenGui
- night.Position = UDim2.new(0, 165, 0, 370)
- night.Size = UDim2.new(0, 50, 0, 20)
- night.BackgroundColor3 = BrickColor.new("Really black").Color
- night.TextColor = BrickColor.new("White")
- night.Text = "Night"
- night.MouseButton1Down:connect(function()
- daytime = false
- nighttime = true
- turnoff = Instance.new("Sound",Character)
- turnoff.SoundId = "rbxassetid://858896518"
- turnoff.Volume = 1
- turnoff.Pitch = .9
- turnoff:Play()
- removeuseless:AddItem(turnoff,2)
- coroutine.wrap(function()
- while nighttime do
- game.Lighting.TimeOfDay = 0
- game.Lighting.GlobalShadows = false
- game.Lighting.Ambient = Color3.new(0,0,0)
- game.Lighting.Brightness = 0
- wait()
- end
- end)()
- end)
- volumeup = Instance.new("ImageButton")
- volumeup.Parent = screenGui
- volumeup.Position = UDim2.new(0, 29, 0, 327)
- volumeup.BackgroundTransparency = 1
- volumeup.Size = UDim2.new(0, 25, 0, 25)
- volumeup.Image = "rbxassetid://29563813"
- volumeup.MouseButton1Down:connect(function()
- if soundIsPlaying then
- vol.Text = vol.Text + 1
- end
- end)
- volumedown = Instance.new("ImageButton")
- volumedown.Parent = screenGui
- volumedown.Rotation = 180
- volumedown.Position = UDim2.new(0, 111, 0, 327)
- volumedown.BackgroundTransparency = 1
- volumedown.Size = UDim2.new(0, 25, 0, 25)
- volumedown.Image = "rbxassetid://29563813"
- Supr14 = Instance.new("ImageLabel")
- Supr14.Parent = screenGui
- Supr14.Rotation = 0
- Supr14.Position = UDim2.new(0, 13, 0, 222)
- Supr14.BackgroundTransparency = 1
- Supr14.Size = UDim2.new(0, 240, 0, 60)
- Supr14.Image = "rbxassetid://1815697653"
- volumedown.MouseButton1Down:connect(function()
- if soundIsPlaying then
- vol.Text = vol.Text - 1
- end
- end)
- stopbutton.MouseButton1Down:connect(function()
- if idrewsomething then
- if soundIsPlaying then
- sound1:Remove()
- soundIsPlaying = false
- workspace.CurrentCamera.FieldOfView = 70
- pitch.Text = "Pitch"
- vol.Text = "Volume"
- for i,v in pairs(tab) do
- v.Enabled = false
- end
- for i = 1, 10 do
- for _,v in pairs(tab2) do
- v.BrickColor = BrickColor.new("Really black")
- v.Size = v.Size - Vector3.new(0,15,0)
- end
- wait()
- end
- end
- end
- end)
- print("Drawing visualiser!, Made by Supr14")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement