This forum is going to be locked at the end of this year and eventually going offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk
Make sure to read the rules.
Make sure to read the rules.
How to when to use a specific command to activate a trigger automatically
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
- Kevi
- Meatbag
- Posts: 3
- Joined: Thu Jun 11, 2020 3:36 am
- Title: lozango
- SFD Account: Lozango com z
- Location: Brazil, Rio de Janeiro RJ
- Gender:
- Age: 17
How to when to use a specific command to activate a trigger automatically
0 x
i am steve
- Odex64
- Superfighter

- Posts: 172
- Joined: Sat Jul 29, 2017 12:39 pm
- Title: Content Creator
- SFD Account: Odex64
- Started SFD: PreAlpha
- Location: Italy
- Gender:
- Age: 23
Code: Select all
public void OnStartup()
{
Events.UserMessageCallback.Start(Commands);
}
public void Commands(UserMessageCallbackArgs cmds)
{
if (cmds.IsCommand && cmds.User.IsModerator)
{
switch (cmds.Command)
{
case "EXPLOSION": //NAME OF THE COMMAND
((IObjectTrigger) Game.GetSingleObjectByCustomId("exp")).Trigger(); //USE THIS TO ACTIVATE 1 TRIGGER
break;
case "SPAWN":
foreach(IObjectTrigger spwn in Game.GetObjectsByCustomId("spawn")) //USE THIS TO ACTIVATE MULTIPLE TRIGGERS
spwn.Trigger();
break;
}
}
}
2 x
