SHARE
TWEET

Untitled

dwdadad Oct 18th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7.     print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8.     script.Parent = Player.Character
  9.  
  10.     --RemoteEvent for communicating
  11.     local Event = Instance.new("RemoteEvent")
  12.     Event.Name = "UserInput_Event"
  13.  
  14.     --Fake event to make stuff like Mouse.KeyDown work
  15.     local function fakeEvent()
  16.         local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17.         t.connect = t.Connect
  18.         return t
  19.     end
  20.  
  21.     --Creating fake input objects with fake variables
  22.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26.     end}
  27.     --Merged 2 functions into one by checking amount of arguments
  28.     CAS.UnbindAction = CAS.BindAction
  29.  
  30.     --This function will trigger the events that have been :Connect()'ed
  31.     local function te(self,ev,...)
  32.         local t = m[ev]
  33.         if t and t._fakeEvent and t.Function then
  34.             t.Function(...)
  35.         end
  36.     end
  37.     m.TrigEvent = te
  38.     UIS.TrigEvent = te
  39.  
  40.     Event.OnServerEvent:Connect(function(plr,io)
  41.         if plr~=Player then return end
  42.         if io.isMouse then
  43.             m.Target = io.Target
  44.             m.Hit = io.Hit
  45.         else
  46.             local b = io.UserInputState == Enum.UserInputState.Begin
  47.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49.             end
  50.             for _,t in pairs(CAS.Actions) do
  51.                 for _,k in pairs(t.Keys) do
  52.                     if k==io.KeyCode then
  53.                         t.Function(t.Name,io.UserInputState,io)
  54.                     end
  55.                 end
  56.             end
  57.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59.         end
  60.     end)
  61.     Event.Parent = NLS([==[
  62.     local Player = game:GetService("Players").LocalPlayer
  63.     local Event = script:WaitForChild("UserInput_Event")
  64.  
  65.     local UIS = game:GetService("UserInputService")
  66.     local input = function(io,a)
  67.         if a then return end
  68.         --Since InputObject is a client-side instance, we create and pass table instead
  69.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70.     end
  71.     UIS.InputBegan:Connect(input)
  72.     UIS.InputEnded:Connect(input)
  73.  
  74.     local Mouse = Player:GetMouse()
  75.     local h,t
  76.     --Give the server mouse data 30 times every second, but only if the values changed
  77.     --If player is not moving their mouse, client won't fire events
  78.     while wait(1/30) do
  79.         if h~=Mouse.Hit or t~=Mouse.Target then
  80.             h,t=Mouse.Hit,Mouse.Target
  81.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  82.         end
  83.     end]==],Player.Character)
  84.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. print[[
  88.     Created by Biologically_Noob
  89.     Disc: Bio#6428
  90.     Help from MonolithicDivinity and Cron
  91.     VengefulProgram's House
  92.     Updoot log
  93.     The decoration update
  94.     Added:
  95.     -Sword on the wall
  96.     -Jojo boie
  97.     -FORKING FLOWERS THAT I FORGOT TO ANCHOR
  98.     -Clock that doesn't work
  99.     -Drawer with a lamp
  100.     -Materials to the bed
  101.     -Sum decorations
  102.    
  103. ]]
  104. -- Thanks for using Mod2S by NopeUsername
  105. local functions = {}
  106. function sandbox(script, func)
  107.     local oldEnv = getfenv(func)
  108.     local newEnv = setmetatable({}, {
  109.         __index = function(self,k)
  110.             if k == "script" then
  111.                 return script
  112.             else
  113.                 return oldEnv[k]
  114.             end
  115.         end,
  116.     })
  117.     return setfenv(func, newEnv)
  118. end
  119. local mas = Instance.new("Model", game:GetService("Lighting"))
  120. local Sans = Instance.new("Part")
  121. local Stage = Instance.new("Attachment")
  122. local Beam = Instance.new("Beam")
  123. local Head = Instance.new("Attachment")
  124. local Music = Instance.new("Sound")
  125. local TrumpetBoyScript = Instance.new("Script")
  126. local TrumpetBoyAnimator = Instance.new("LocalScript")
  127. Sans.Anchored = true
  128. Sans.BottomSurface = Enum.SurfaceType.Smooth
  129. Sans.CFrame = CFrame.new(-21.05,4.38,-61.12,-1,0,0,0,1,0,0,0,-1)
  130. Sans.Size = Vector3.new(1.8,8.76,5.8)
  131. Sans.TopSurface = Enum.SurfaceType.Smooth
  132. Sans.Transparency = 1
  133. Sans.Name = "Sans"
  134. Sans.Parent = mas
  135. Stage.CFrame = CFrame.new(0,-4.38,0,1,0,0,0,1,0,0,0,1)
  136. Stage.Position = Vector3.new(0,-4.38,0)
  137. Stage.Name = "Stage"
  138. Stage.Parent = Sans
  139. Beam.Attachment0 = Head
  140. Beam.Attachment1 = Stage
  141. Beam.FaceCamera = true
  142. Beam.LightInfluence = 1
  143. Beam.Texture = "rbxassetid://2880438023"
  144. Beam.TextureSpeed = 0
  145. Beam.Transparency = NumberSequence.new(0)
  146. Beam.Width0 = 4
  147. Beam.Width1 = 4
  148. Beam.Parent = Sans
  149. Head.Axis = Vector3.new(-1,0,0)
  150. Head.CFrame = CFrame.new(0,4.38,0,-1,0,0,0,1,0,0,0,-1)
  151. Head.Orientation = Vector3.new(0,180,0)
  152. Head.Position = Vector3.new(0,4.38,0)
  153. Head.Rotation = Vector3.new(-180,0,-180)
  154. Head.Name = "Head"
  155. Head.Parent = Sans
  156. Music.Looped = true
  157. Music.Playing = true
  158. Music.SoundId = "rbxassetid://2372056506"
  159. Music.Volume = 1
  160. Music.Name = "Music"
  161. Music.Parent = Sans
  162. table.insert(functions,sandbox(TrumpetBoyScript,function()
  163. local CollectionService = game:GetService("CollectionService")
  164. local Players = game:GetService("Players")
  165. local StarterPlayer = game:GetService("StarterPlayer")
  166. local playerScripts = StarterPlayer:WaitForChild("StarterPlayerScripts")
  167. local animator = script:WaitForChild("TrumpetBoyAnimator",5)
  168. if animator and not playerScripts:FindFirstChild("TrumpetBoyAnimator") then
  169.     for _,player in pairs(Players:GetPlayers()) do
  170.         local backpack = player:WaitForChild("Backpack")
  171.         local newAnimator = animator:Clone()
  172.         newAnimator.Parent = backpack
  173.         newAnimator.Disabled = false
  174.     end
  175.     animator.Parent = playerScripts
  176.     animator.Disabled = false
  177. end
  178. local trumpetBoy = script.Parent
  179. CollectionService:AddTag(trumpetBoy, "TrumpetBoy")
  180. local music = trumpetBoy:WaitForChild("Music")
  181. music:Play()
  182. end))
  183. TrumpetBoyScript.Name = "TrumpetBoyScript"
  184. TrumpetBoyScript.Parent = Sans
  185. table.insert(functions,sandbox(TrumpetBoyAnimator,function()
  186. local CollectionService = game:GetService("CollectionService")
  187. local RunService = game:GetService("RunService")
  188. local trumpetBoys = {}
  189. local trumpetBoyAdd = CollectionService:GetInstanceAddedSignal("TrumpetBoy")
  190. local trumpetBoyRemove = CollectionService:GetInstanceRemovedSignal("TrumpetBoy")
  191. local function addTrumpetBoy(trumpetBoy)
  192.     local music = trumpetBoy:WaitForChild("Music")
  193.     local head = trumpetBoy:WaitForChild("Head")
  194.     local beam = trumpetBoy:WaitForChild("Beam")
  195.     local lastLoudness = 0
  196.     local rng = Random.new()
  197.     local function update()
  198.         local loudness = music.PlaybackLoudness / 1000
  199.         local diff = math.abs(lastLoudness - loudness)
  200.         local size = trumpetBoy.Size
  201.         local rngX = rng:NextNumber(-1,1) * loudness * 100
  202.         local rngZ = rng:NextNumber(-1,1) * loudness * 100
  203.         local height = (1 + loudness)*size.Y
  204.         local goalCF = CFrame.new(rngX, height/2, rngZ)
  205.         head.CFrame = head.CFrame:Lerp(goalCF,diff)
  206.         lastLoudness = loudness
  207.     end
  208.     trumpetBoys[trumpetBoy] = RunService.RenderStepped:Connect(update)
  209. end
  210. local function removeTrumpetBoy(trumpetBoy)
  211.     if trumpetBoys[trumpetBoy] then
  212.         trumpetBoys[trumpetBoy]:Disconnect()
  213.         trumpetBoys[trumpetBoy] = nil
  214.     end
  215. end
  216. for _,trumpetBoy in pairs(CollectionService:GetTagged("TrumpetBoy")) do
  217.     addTrumpetBoy(trumpetBoy)
  218. end
  219. trumpetBoyAdd:Connect(addTrumpetBoy)
  220. trumpetBoyRemove:Connect(removeTrumpetBoy)
  221. end))
  222. TrumpetBoyAnimator.Disabled = true
  223. TrumpetBoyAnimator.Name = "TrumpetBoyAnimator"
  224. TrumpetBoyAnimator.Parent = TrumpetBoyScript
  225. for i,v in ipairs(functions) do
  226.     spawn(function()
  227.         pcall(v)
  228.     end)
  229. end
  230. for i,v in ipairs(mas:GetChildren()) do
  231.     v.Parent = workspace
  232. end
  233. mas:Destroy()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top