New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do you make a power system like FNaF?

Asked by
zpfran -13
15 days ago
Edited 15 days ago

I am trying to make a power system like Five Nights At Freddy's and I can't figure out how to make the number of doors closed take away power faster. The Int value NumClosed is added to when a door is closed it adds one to the Number of doors closed. The power Int value starts at 100 and I want it to decrease, however, when I put it into this script:

local power = game.Workspace["Office Stuff"].Power
local doorsclosed = game.Workspace["Office Stuff"].NumClosed
local powerdrainC = game.Workspace["Office Stuff"].ContinousPowerDrainTime

while true do
    wait(powerdrainC.Value - doorsclosed.Value)
    power.Value = power.Value - 1
end

this script is in serverscriptservice BTW It doesn't work and It doesn't subtract from the power value. Can someone help me figure out what to do?

0
try to put the script into a server script, unless it already is BradNewTypical 167 — 15d
0
oh ok zpfran -13 — 15d
0
It is now in server script service now what (it still doesnt work :/ ) zpfran -13 — 15d

Answer this question