Advertisement
DaOMEGAa32

fe fnaf freddy

May 26th, 2019
1,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.26 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. local lp = game.Players.LocalPlayer
  153. local chr = lp.Character
  154. local mouse = lp:GetMouse()
  155. local euler = CFrame.fromEulerAnglesXYZ
  156. local rad = math.rad
  157. local trso = chr.Torso
  158. local la = Instance.new("Weld",chr['Left Arm'])
  159. la.Part0=chr['Left Arm']
  160. la.Part1=chr.Torso
  161. la.C0=CFrame.new(1.5,0,0)
  162. local rot = 0
  163.  
  164. local ContentProvider = Game:GetService("ContentProvider")
  165.  
  166. local function LoadAssets(AssetList)
  167. -- Takes an asset list and preloads it. Will not wait for them to load.
  168.  
  169. for _, AssetId in pairs(AssetList) do
  170. ContentProvider:Preload("http://www.roblox.com/asset/?id=" .. AssetId)
  171. end
  172. end
  173.  
  174. LoadAssets({203654824, 192187815, 179678714, 193107910, 187990139})
  175.  
  176.  
  177.  
  178.  
  179. if chr:FindFirstChild("Shirt") then
  180. chr.Shirt:destroy()
  181. end
  182.  
  183. if chr:FindFirstChild("Pants") then
  184. chr.Pants:destroy()
  185. end
  186.  
  187. colors = chr['Body Colors']
  188.  
  189. colors.HeadColor = BrickColor.new("Brown")
  190. colors.TorsoColor = BrickColor.new("Brown")
  191. colors.LeftArmColor = BrickColor.new("Brown")
  192. colors.RightArmColor = BrickColor.new("Brown")
  193. colors.LeftLegColor = BrickColor.new("Brown")
  194. colors.RightLegColor = BrickColor.new("Brown")
  195.  
  196.  
  197. local face = chr.Head:FindFirstChild("face")
  198.  
  199. if face then
  200. face.Texture = "http://www.roblox.com/asset/?id=187990139"
  201. end
  202.  
  203. for i,v in pairs(chr:children()) do
  204. if v.ClassName == "Hat" then
  205. print(v.Name.." has been removed, #baldforbieber")
  206. v:destroy()
  207. end
  208. end
  209.  
  210.  
  211.  
  212.  
  213.  
  214. local hd = Instance.new("Weld",chr.Head)
  215. hd.Part0=chr.Head
  216. hd.Part1=chr.Torso
  217. hd.C0=CFrame.new(0,-1.5,0)
  218.  
  219.  
  220. hum = chr.Humanoid
  221.  
  222.  
  223.  
  224. function CreateMesh(parent, id, x, y, z, texture)
  225. local m=Instance.new("SpecialMesh", parent)
  226. m.MeshType = "FileMesh"
  227. m.MeshId="http://www.roblox.com/asset/?id="..id
  228. if texture ~= nil then
  229. m.TextureId="http://www.roblox.com/asset/?id="..texture
  230. end
  231. m.Scale = Vector3.new(x,y,z)
  232. end
  233.  
  234. Microphone=function()
  235. mic = Instance.new("Part", chr)
  236. CreateMesh(mic, 43996479, 0.3, 0.3, 0.3, 43997070)
  237. mic.Name = "Microphone"
  238. mic.Locked = true
  239. mic.CanCollide=true
  240. mic.Size=Vector3.new(1,1,1)
  241. micw = Instance.new("Weld",mic)
  242. micw.Part0=mic
  243. micw.Part1=chr['Left Arm']
  244. micw.C0=CFrame.new(0,0,0)
  245. micw.C1=euler(rad(0),rad(0),rad(0))
  246. end
  247.  
  248. Hat=function()
  249. hat = Instance.new("Part", chr)
  250. CreateMesh(hat, 1028713, 1, 1, 1)
  251. hat.Name = "Top hat"
  252. hat.Locked = true
  253. hat.BrickColor = BrickColor.new("Really black")
  254. hat.CanCollide=true
  255. hat.Size=Vector3.new(1,1,1)
  256. hatw = Instance.new("Weld",hat)
  257. hatw.Part0=hat
  258. hatw.Part1=chr['Head']
  259. hatw.C0=CFrame.new(0,-0.7,0)
  260. hatw.C1=euler(rad(0),rad(0),rad(0))
  261. end
  262.  
  263. Hat()
  264. Microphone()
  265.  
  266.  
  267. function Name(msg)
  268. if hat.Parent then
  269. pcall(function()
  270. local Gui = Instance.new('BillboardGui', hat)
  271. Gui.ExtentsOffset = Vector3.new(0,1.5,0)
  272. Gui.Size = UDim2.new(0,200,0,300)
  273. local Frame = Instance.new('Frame',Gui)
  274. Frame.BackgroundTransparency = 1
  275. Frame.Size = UDim2.new(1,0,1,0)
  276. local Txt = Instance.new('TextLabel',Frame)
  277. Txt.BackgroundTransparency = 1
  278. Txt.Size = UDim2.new(1,0,1,0)
  279. Txt.Font = 'ArialBold'
  280. Txt.FontSize = 'Size24'
  281. Txt.Text = msg
  282. Txt.TextColor3 = BrickColor.new("Brown").Color
  283. Txt.TextStrokeColor3 = Color3.new(0/255,0/255,0/255)
  284. Txt.TextStrokeTransparency = .5
  285. Txt.TextWrapped = true
  286. Txt.TextScaled = false
  287. end)
  288. else
  289. end
  290. end
  291.  
  292. function Chat(msg) -- Credit to jillmiles1, kthxbye
  293. if hat.Parent then
  294. pcall(function()
  295. if hat:FindFirstChild("Fazbear Chat Gui") then
  296. hat['Fazbear Chat Gui']:destroy()
  297. end
  298. local Gui = Instance.new('BillboardGui', hat)
  299. Gui.Name = "Fazbear Chat Gui"
  300. Gui.ExtentsOffset = Vector3.new(0,3,0)
  301. Gui.Size = UDim2.new(0,200,0,300)
  302. local Frame = Instance.new('Frame',Gui)
  303. Frame.BackgroundTransparency = 1
  304. Frame.Size = UDim2.new(1,0,1,0)
  305. local Txt = Instance.new('TextLabel',Frame)
  306. Txt.BackgroundTransparency = 1
  307. Txt.Size = UDim2.new(1,0,1,0)
  308. Txt.Font = 'ArialBold'
  309. Txt.Name = "ChatGui"
  310. Txt.FontSize = 'Size24'
  311. Txt.Text = ''
  312. Txt.TextColor3 = BrickColor.new("Brown").Color
  313. Txt.TextStrokeColor3 = Color3.new(0/255,0/255,0/255)
  314. Txt.TextStrokeTransparency = .5
  315. Txt.TextWrapped = true
  316. Txt.TextScaled = false
  317. delay(wait(),function()
  318. for v = 1, #msg do
  319. Txt.Text=string.sub(msg,1,v)
  320. wait(.07)
  321. end;
  322. wait(1)
  323. for v = 1, #Txt.Text do
  324. Txt.Text=string.sub(msg,-1,v)
  325. wait(.05)
  326. end;
  327. Gui:remove()
  328. end)
  329. end)
  330. else
  331. end
  332. end
  333.  
  334.  
  335. local crouch = function()
  336. la.C1=euler(rad(-90),rad(0),rad(0))
  337. hd.C1=euler(rad(0),rad(-3),rad(10))
  338. micw.C1=euler(rad(0),rad(0),rad(0))
  339. micw.C0=CFrame.new(0,-1,0)
  340. la.C0=CFrame.new(1.5,-.5,-.5)
  341. end
  342.  
  343. local stand = function()
  344. la.C1=euler(rad(0),rad(0),rad(0))
  345. hd.C1=euler(rad(0),rad(0),rad(0))
  346. micw.C1=euler(rad(180),rad(0),rad(0))
  347. la.C0=CFrame.new(1.5,0,0)
  348. micw.C0=CFrame.new(0,-1,0)
  349. end
  350.  
  351. function PlaySound(id, pitch, looped)
  352. epicsound = Instance.new("Sound")
  353. epicsound.Name = "FazbearSound"
  354. epicsound.SoundId = "rbxassetid://"..id
  355. epicsound.Volume = 1
  356. epicsound.Pitch = pitch
  357. if looped == nil then
  358. looped = true
  359. else
  360. looped = looped
  361. end
  362. wait()
  363. epicsound.Looped = looped
  364. epicsound.Parent = workspace
  365. if epicsound.SoundId=="rbxassetid://tt" then -- TELL ME, TELL ME, WHERE DA FREAKS AT!
  366. epicsound.SoundId="rbxassetid://181158033"
  367. elseif epicsound.SoundId=="rbxassetid://fabulous" then -- FA-FA-FABULOUS!
  368. epicsound.SoundId="rbxassetid://191819419"
  369. elseif epicsound.SoundId=="rbxassetid://ufdb" then -- ultimate final death battle(fairy tail XD)
  370. epicsound.SoundId="rbxassetid://153085393"
  371. elseif epicsound.SoundId=="rbxassetid://nnm" then
  372. epicsound.SoundId="rbxassetid://210189234"
  373. elseif epicsound.SoundId=="rbxassetid://tun" then -- tunak tunak tun
  374. epicsound.SoundId="rbxassetid://162682002"
  375. elseif epicsound.SoundId=="rbxassetid://zelda" then
  376. epicsound.SoundId="rbxassetid://158215156"
  377. elseif epicsound.SoundId=="rbxassetid://cc" then
  378. epicsound.SoundId="rbxassetid://177080835"
  379. end
  380. es=epicsound:clone()
  381. es:Stop()
  382. es.Parent = chr.Torso
  383. wait()
  384. es:Play()
  385. end
  386.  
  387. hum.WalkSpeed=50
  388. hum.MaxHealth = math.huge
  389. hum.Health = math.huge
  390.  
  391.  
  392. lp.Chatted:connect(function(msg)
  393. Chat(msg)
  394. end)
  395.  
  396. goldie=true
  397. crouch()
  398.  
  399. function StopMusic()
  400. if chr.Torso:FindFirstChild("FazbearSound") then
  401. if chr.Torso.FazbearSound.ClassName == "Sound" then
  402. chr.Torso.FazbearSound:Stop()
  403. wait()
  404. chr.Torso.FazbearSound:Destroy()
  405. end
  406. end
  407. end
  408.  
  409. Name("Freddy Fazbear")
  410.  
  411.  
  412. mouse.KeyDown:connect(function(key)
  413. if key == "g" then
  414. if goldie==false then
  415. goldie=true
  416. crouch()
  417. elseif goldie==true then
  418. goldie=false
  419. stand()
  420. end
  421. elseif key == "r" then -- Plays a song
  422. StopMusic()
  423. PlaySound(203654824, 1, true)
  424. Chat("Now Playing: The Show Must Go On - FNAF | 203654824")
  425. elseif key == "f" then -- Plays a song
  426. StopMusic()
  427. PlaySound(192187815, 1, true)
  428. Chat("Now Playing: Fnaf 2: It's Been so Long | 192187815")
  429. elseif key == "l" then -- Plays a laugh
  430. StopMusic()
  431. PlaySound(179678714, 0.39, false)
  432. Chat("*laugh*")
  433. elseif key == "v" then -- Plays a scream
  434. StopMusic()
  435. PlaySound(193107910, 1, false)
  436. Chat("*screams*")
  437. elseif key == "q" then -- Stops any sound(s) playing from your torso
  438. StopMusic()
  439. Chat("All sounds stopped!")
  440. end
  441. end)
  442.  
  443.  
  444.  
  445. hum.Died:connect(function()
  446. es.Pitch = 10
  447. wait()
  448. es:Pause()
  449. es:Stop()
  450. es.Name = "Ded"
  451. wait()
  452. es:Destroy()
  453. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement