So this script is supposed to parent a part to workspace every 5 seconds, I was doing a test run to make sure the code works but nothing is printed when active is true. Here's my code;
local active = script.Parent.active local donutfolder = game.ServerStorage.donuts local donutcode = script.Parent.donutcode while true do if active.Value then elseif donutcode.Value == 1 then --> This is the line of code I know is causing it. print("peter 'allah' griffin") else warn('inactive11!!!!1!') end wait(5) end
Check line 6. How can I change line 6 so the print below it works?
I think the problem is that you are checking first if active.Value is true ... which looks like it is true because its skipping the elseif's statements.
To test this out go to the active which is script.Parent and remove its value to make it false or nil, this will make the elseif run.
Unless you want both if statements to run so if active.Value is true check donutcode.Value your code then should look like this
local active = script.Parent.active local donutfolder = game.ServerStorage.donuts local donutcode = script.Parent.donutcode while true do if active.Value then if donutcode.Value == 1 then print("peter 'allah' griffin") else warn('inactive11!!!!1!') end end wait(5) end