NicoAFV1212 Posted September 2, 2020 Posted September 2, 2020 I need help with this script, In this script the event // OnClock<hour><minute>: donpcevent "<npc_name>::OnStart"; OnClock0000: donpcevent "Event_1::OnStart"; end; OnClock0400: donpcevent "Event_2::OnStart"; end; OnClock0800: donpcevent "Event_3::OnStart"; end; OnClock1200: donpcevent "Event_4::OnStart"; end; OnClock1600: donpcevent "Event_5::OnStart"; end; OnClock2000: donpcevent "Event_6::OnStart"; end; This script is programmed so that each event starts at the specified time, my problem is that they are not random. I want 1 of those 6 events to start at 00:00 and so on at all hours Quote
0 sader1992 Posted September 2, 2020 Posted September 2, 2020 (edited) something like this ? // OnClock<hour><minute>: donpcevent "<npc_name>::OnStart"; OnClock0000: OnClock0400: OnClock0800: OnClock1200: OnClock1600: OnClock2000: switch(rand(1,6)){ case 1: donpcevent "Event_1::OnStart"; end; case 2: donpcevent "Event_2::OnStart"; end; case 3: donpcevent "Event_3::OnStart"; end; case 4: donpcevent "Event_4::OnStart"; end; case 5: donpcevent "Event_5::OnStart"; end; case 6: donpcevent "Event_6::OnStart"; end; } or // OnClock<hour><minute>: donpcevent "<npc_name>::OnStart"; OnClock0000: OnClock0400: OnClock0800: OnClock1200: OnClock1600: OnClock2000: donpcevent "Event_" + rand(1,6) + "::OnStart"; end; Edited September 2, 2020 by sader1992 Quote
0 NicoAFV1212 Posted September 2, 2020 Author Posted September 2, 2020 (edited) I put the script and I get that. in that line the npc ends with} Nope NidManager.txt What is wrong? Edited September 2, 2020 by NicoAFV1212 Quote
0 Royr Posted September 2, 2020 Posted September 2, 2020 (edited) 1 hour ago, NicoAFV1212 said: I put the script and I get that. in that line the npc ends with} Simply add "}" after the end; Edited September 2, 2020 by Royr Quote
0 NicoAFV1212 Posted September 3, 2020 Author Posted September 3, 2020 2 hours ago, sader1992 said: I have to delete that "}" ? Quote
0 sader1992 Posted September 3, 2020 Posted September 3, 2020 16 minutes ago, NicoAFV1212 said: I have to delete that "}" ? no , when you copied the code , you didn't copy this! in the file you provided , write the missing } under the code Quote
Question
NicoAFV1212
I need help with this script, In this script the event
This script is programmed so that each event starts at the specified time, my problem is that they are not random. I want 1 of those 6 events to start at 00:00 and so on at all hours
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.