Everlast
Member
Hello guys im trying to activate a dungeon entrance by day and hour,ill tryed that:
Then:
Im learning C# now so im so new,searching around google it says i need to return a value,but dont understand,anyone can help a bit or explain?Ty!
UPDATE
Now script load,i just replace void per bool,so the code is:
Now just see if its working ty!
I want the teleport is open from sunday at 22 to saturday at 22
C#:
public void Activated()
{
DayOfWeek wk = DateTime.Today.DayOfWeek;
if (wk == DayOfWeek.Saturday && DateTime.Now.Hour == 22)
{
return true;
}
if (wk == DayOfWeek.Sunday && DateTime.Now.Hour == 22)
{
return false;
}
}
C#:
if (Activated())
{
StartTeleport(m);
return true;
}
Post automatically merged:
UPDATE
Now script load,i just replace void per bool,so the code is:
C#:
public bool Activated()
{
DayOfWeek wk = DateTime.Today.DayOfWeek;
if (wk == DayOfWeek.Saturday && DateTime.Now.Hour == 22)
{
return true;
}
if (wk == DayOfWeek.Sunday && DateTime.Now.Hour == 22)
{
return false;
}
return false;
}
I want the teleport is open from sunday at 22 to saturday at 22
Last edited: