Fifkee

Foxy from FNAF2 code in roblox.

Mar 15th, 2018
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 KB | None | 0 0
  1. --local f = Instance.new("Part", workspace)
  2. --f.Name = "Foxy"
  3. lightoff = true
  4. foxyenabled = false
  5. --Doesn't need any configuration. Go wild.
  6. local numberValue = Instance.new("NumberValue", game.ReplicatedStorage)
  7. numberValue.Name = 'Foxy\'s Patience'
  8. numberValue.Value = 150
  9. spawn(function(addtime)
  10.     while wait() do
  11.         if not lightoff and foxyenabled then
  12.             numberValue.Value = numberValue.Value+3
  13.         end
  14.     end
  15. end)
  16. spawn(function(foxyparameters)
  17.     while wait(2) do
  18.         if lightoff and foxyenabled then
  19.             numberValue.Value = numberValue.Value-15
  20.         end
  21.     end
  22. end)
  23. game:GetService('RunService').RenderStepped:connect(function(repeatedfunctions)
  24.     if numberValue.Value > 150 then
  25.         numberValue.Value = 150
  26.     elseif numberValue.Value < 0 then
  27.         numberValue.Value = 0
  28.     end
  29.     game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid").Name = tostring(math.random(1, 100000))
  30. end)
  31.  
  32. game:GetService('UserInputService').InputBegan:connect(function(turnonlight)
  33.     if turnonlight.KeyCode == Enum.KeyCode.LeftControl then
  34.     lightoff = false
  35.     wait(0.04)
  36.     lightoff = true
  37.     end
  38. end)
  39.  
  40. game:GetService('UserInputService').InputEnded:connect(function(turnofflight)
  41.     if turnofflight.KeyCode == Enum.KeyCode.LeftControl then
  42.     lightoff = true
  43.     end
  44. end)
  45.  
  46. spawn(function(s)
  47.     while wait(2) do
  48.         local returnvalues = {"20", "7", "15"}
  49.         local variable = tostring(math.random(1, 20))
  50.         if returnvalues[variable] then
  51.             foxyenabled = not foxyenabled
  52.         end
  53.         print("Foxy Status: ".. tostring(foxyenabled)..". ("..variable..")")
  54.     end
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment