Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MINECRAFT NOTEBLOCK SCRIPT BY HENLOMYDUDE--
- if game:GetService("RunService"):IsClient()then error("Run as r/ and not rl/")end;print("FE Converter by HenloMyDude");InternalData = {}
- do
- script.Parent = owner.Character
- local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
- local function NewFakeEvent()
- local Bind = Instance.new("BindableEvent")
- local Fake;Fake = {Connections = {},
- fakeEvent=true;
- Connect=function(self,Func)
- Bind.Event:connect(Func)
- self.Connections[Bind] = true
- return setmetatable({Connected = true},{
- __index = function (self,Index)
- if Index:lower() == "disconnect" then
- return function() Fake.Connections[Bind] = false;self.Connected = false end
- end
- return Fake[Index]
- end;
- __tostring = function() return "Connection" end;
- })
- end}
- Fake.connect = Fake.Connect;return Fake;
- end
- local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
- local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
- local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
- self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
- end};ContextActionService.UnBindAction = ContextActionService.BindAction
- local function TriggerEvent(self,Event,...)
- local Trigger = Mouse[Event]
- if Trigger and Trigger.fakeEvent and Trigger.Connections then
- for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
- end
- end
- Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
- Event.OnServerEvent:Connect(function(FiredBy,Input)
- if FiredBy.Name ~= owner.Name then return end
- if Input.MouseEvent then
- Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
- else
- local Begin = Input.UserInputState == Enum.UserInputState.Begin
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
- for _,Action in pairs(ContextActionService.Actions) do
- for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
- end
- Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
- UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
- end
- end)
- InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
- Event.Parent = NLS([[
- local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
- local Input = function(Input,gameProcessedEvent)
- if gameProcessedEvent then return end
- Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
- end
- UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
- local Hit,Target
- while wait(1/30) do
- if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
- Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
- end
- end
- ]],owner.Character)
- end
- RealGame = game;game = setmetatable({},{
- __index = function (self,Index)
- local Sandbox = function (Thing)
- if Thing:IsA("Player") then
- local RealPlayer = Thing
- return setmetatable({},{
- __index = function (self,Index)
- local Type = type(RealPlayer[Index])
- if Type == "function" then
- if Index:lower() == "getmouse" or Index:lower() == "mouse" then
- return function (self)return InternalData["Mouse"] end
- end
- return function (self,...)return RealPlayer[Index](RealPlayer,...) end
- end
- return RealPlayer[Index]
- end;
- __tostring = function(self) return RealPlayer.Name end
- })
- end
- end
- if RealGame[Index] then
- local Type = type(RealGame[Index])
- if Type == "function" then
- if Index:lower() == "getservice" or Index:lower() == "service" then
- return function (self,Service)
- local FakeServices = {
- ["players"] = function()
- return setmetatable({},{
- __index = function (self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...)end
- else
- if Index2:lower() == "localplayer" then return Sandbox(owner) end
- return RealService[Index2]
- end
- end;
- __tostring = function(self) return RealGame:GetService(Service).Name end
- })
- end;
- ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
- ["userinputservice"] = function() return InternalData["UserInputService"] end;
- ["runservice"] = function()
- return setmetatable({},{
- __index = function(self2,Index2)
- local RealService = RealGame:GetService(Service)
- local Type2 = type(Index2)
- if Type2 == "function" then
- return function (self,...) return RealService[Index2](RealService,...) end
- else
- local RunServices = {
- ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
- ["renderstepped"] = function() return RealService["Stepped"] end
- }
- if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
- return RealService[Index2]
- end
- end
- })
- end
- }
- if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
- return RealGame:GetService(Service)
- end
- end
- return function (self,...) return RealGame[Index](RealGame,...) end
- else
- if game:GetService(Index) then return game:GetService(Index) end
- return RealGame[Index]
- end
- end
- return nil
- end
- });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
- --MINECRAFT NOTEBLOCK BY HENLOMYDUDE--
- plr = owner
- char = plr.Character
- arm = char["Left Arm"]
- mouse = plr:GetMouse()
- torso = char.Torso
- --USEFUL VALUES--
- CF = CFrame
- IT = Instance.new
- V3 = Vector3.new
- V2 = Vector2.new
- POS = mouse.Hit
- --START CONTROLS--
- placed = false
- function PLACE()
- placed = true
- local noteblock = IT("Part",workspace)
- noteblock.Name = "noteyblock"
- noteblock.Position = mouse.Hit.p + Vector3.new(0, 2, 0)
- noteblock.Anchored = true
- noteblock.BrickColor = BrickColor.new("Brown")
- noteblock.Size = V3(4,4,4)
- local decal = IT("Decal",noteblock)
- decal.Face = "Front"
- decal.Texture = "http://www.roblox.com/asset/?id=59262397"
- local decal = IT("Decal",noteblock)
- decal.Face = "Back"
- decal.Texture = "http://www.roblox.com/asset/?id=59262397"
- local decal = IT("Decal",noteblock)
- decal.Face = "Left"
- decal.Texture = "http://www.roblox.com/asset/?id=59262397"
- local decal = IT("Decal",noteblock)
- decal.Face = "Right"
- decal.Texture = "http://www.roblox.com/asset/?id=59262397"
- local decal = IT("Decal",noteblock)
- decal.Face = "Top"
- decal.Texture = "http://www.roblox.com/asset/?id=59262397"
- local decal = IT("Decal",noteblock)
- decal.Face = "Bottom"
- decal.Texture = "http://www.roblox.com/asset/?id=59262397"
- local sound = IT("Sound",noteblock)
- sound.Playing = true
- sound.Looped = true
- sound.Volume = 10
- sound.SoundId = ""
- local sur = Instance.new("BillboardGui", noteblock)
- sur.Name = "Billboard"
- sur.Adornee = noteblock
- sur.Size = UDim2.new(10, 0, 5, 0)
- sur.StudsOffset = Vector3.new(0, 5, 0)
- local text = Instance.new("TextLabel", sur)
- text.Text = owner.Name .."'s Note block"
- text.Size = UDim2.new(1, 0, 1, 0)
- text.TextScaled = true
- text.BackgroundTransparency = 1
- text.Font = Enum.Font.Arcade
- text.TextColor3 = Color3.new(1, 1, 1)
- text.TextStrokeTransparency = 0.5
- end
- mouse.Button1Down:connect(function()
- if placed == false then
- PLACE()
- end
- end)
- plr.Chatted:connect(function(message)
- if message:sub(1,4) == "Play" then
- workspace.noteyblock.Sound:Stop()
- workspace.noteyblock.Sound.SoundId = "http://www.roblox.com/asset/?id="..message:sub(6)
- workspace.noteyblock.Sound:Play()
- end
- end)
- plr.Chatted:connect(function(msg)
- msg=msg:lower()
- if msg == "remove" then
- game.Workspace.noteyblock:Destroy()
- placed = false
- end
- end)
- disco = false
- while placed do
- light = Instance.new("PointLight",workspace.noteyblock)
- light.Color = BrickColor.Random().Color
- light.Enabled = true
- light.Range = 30
- light.Color = BrickColor.Random().Color
- wait(0.5)
- end
- warn("Made by HenloMyDude")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement