Team Spartan Cookies & Milk Forums
help with self-destruct timing - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Help and Support (https://teamscm.co.uk/forum-8.html)
+--- Thread: help with self-destruct timing (/thread-3185.html)



help with self-destruct timing - Funlax - 25-02-2020

im currently trying to make it so when i press a button, there is a delay of 10s to run before the ship self destructs.

i have tried with no success. can someone give a step-by-step or something?

Thanks


RE: help with self-destruct timing - mariofludd - 25-02-2020

This E2 should work for what you want. you could do it with wire gates too but meh. If you want an SF ask someone that knows SF.

@name Self Destruct
@inputs Button
@outputs SD

if(Button == 1){
timer("T",10000)
}

if(clk("T")){
SD = 1
}


RE: help with self-destruct timing - Funlax - 25-02-2020

(25-02-2020, 04:11 PM)mariofludd Wrote: This E2 should work for what you want. you could do it with wire gates too but meh. If you want an SF ask someone that knows SF.

@name Self Destruct
@inputs Button
@outputs SD

if(Button == 1){
timer("T",10000)
}

if(clk("T")){
SD = 1
}

Thanks


RE: help with self-destruct timing - The17thDoctor - 26-02-2020

Here's an SF version :
--@name Self Destruct
--@name Self Destruct
--@author Doccoboie
--@class processor

wire.createInputs({"Button"},{"normal"})
wire.createOutputs({"Selfdestruct"},{"normal"})

hook("input","inputhook",function(a,b)
if b == 1 then
time.simple(10,function() wire.ports.Selfdestruct = 1 wire.ports.Selfdestruct = 0 end)
end
end)

Note that if you spam it, it will create countless timers until it crashes so avoid spamming it Smile


RE: help with self-destruct timing - mariofludd - 08-03-2020

if you want an e2 version thats cancelable just ask