Jump to content

Recommended Posts

Posted

I need to set a timer so that after a kill function the person killed by the script is disabled AFTER 5 seconds. Can someone write that quickly? I do not know how, and if you wrote it, it would teach me.

 

if somecommand
  target.kill
  target.disable
endif
end

Posted

The best way to do this is to assign a script to the character who dies and this in an onDeath block.

 

float timer

Begin onDeath

if( timer < 5 )
 Set timer to timer + getSecondsPassed
else
 target.disable
endif

End

 

This way no matter how you kill them their

corpse will become disabled after 5 seconds.

 

You have to have it '< 5' because it starts counting at 0,

so <= 5 would wait 6 seconds, not five.

Posted
Thanks, exactly what I need. It's going to be used for my Ban Hammer mod :D
Posted

Scriptname RBanHammer

ref Target
ref Self
Short DoOnce
Short Strike

Float Timer

begin gamemode
Set target to getself
set self to getself
end

Begin GameMode
if (Target.GetFactionRank Dark02Pirates >=0)
	if DoOnce == 0
		Target.kill
		Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
		Target.PlaySound AMBThunder
		Set DoOnce to 1
endif
endif
	if DoOnce == 1
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
			Target.Disable
			Set DoOnce to 0
			message "Zero Tolerance Policy for Pirates. Pirate Banned by you."
		endif
	endif
		if (Target.GetFactionRank ClarabellaPirates >=0)
			if DoOnce == 0
				Target.kill
				Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
				Target.PlaySound AMBThunder
				Set DoOnce to 1
			endif
		endif
			if DoOnce == 1
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
				Target.Disable
				Set DoOnce to 0
				Message "Zero Tolerance Policy for Pirates. Pirate Banned by you."
			endif
	endif
end
;
;Stopping Pirate If's
;Starting Bandit If's
;
begin GameMode
	if (target.GetFactionRank BanditFaction >= 0)
			if Strike == 0
				target.kill
				Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
				Target.Playsound AMBThunder
				Set Strike to 1
		endif
			if Strike == 1
				message "Bandits steal mod materials. Banned for theft"
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
				target.disable 5
				set strike to 0
			endif
	endif
endif
;
;Stopping Bandit If's
;Starting Fighters Guilds If's
;
end

begin GameMode
	if (target.GetFactionRank FightersGuild >= 0)
			if Strike == 0
				target.modav fatigue -100
				Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
				Target.Playsound AMBThunder;Script by Ranokoa
				Set Strike to 1
		endif
			if Strike == 1
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
				message "Strike for Vigilantism. Leave moderating jobs to moderators."
				target.SetRestrained 1
				set strike to 0
			endif
	endif
endif
;
;Stopping Fighters Guild If's
;Starting Flame If's
;
end

begin GameMode
	if (target.GetFactionRank RFlameFaction >= 0)
			if Strike == 0
				target.kill
				Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
				Target.Playsound AMBThunder
				Set Strike to 1
		endif
			if Strike == 1
				message "Banned for Flaming. If you don't have something nice to cast, don't cast at all."
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
				target.disable 5
				set strike to 0
			endif
	endif
endif
;
;Stopping Flame If's
;Starting Troll If's
;
end

begin GameMode
	if (target.GetFactionRank RTrollFaction >= 0)
			if Strike == 0
				target.kill
				Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
				Target.Playsound AMBThunder
				Set Strike to 1
		endif
			if Strike == 1
				message "Troll Banned. Go somewhere else, you are not welcome in Cyrodiil."
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
				target.disable 5
				set strike to 0
			endif
	endif
endif
end
;
;Stopping Trolls If's
;Starting Thieves Guild If's
;

begin GameMode
	if (target.GetFactionRank ThievesGuild >= 0)
			if Strike == 0
				target.kill
				Target.PlayMagicShaderVisuals effectSummonMythicDawn 5
				Target.Playsound AMBThunder;Script by Ranokoa
				Set Strike to 1
		endif
			if Strike == 1
				message "Banned for Theft - Stealing others content is against the rules!."
				Set timer to timer + getSecondsPassed
				Set timer to 0
			if ( timer < 3 )
				target.disable
				set strike to 0
			endif
	endif
endif
;
;Stopping Theives Guild if's
;Starting Guard If's
;
end

Begin GameMode
	if (target.GetFactionRank AnvilGuards >=0)
				player.addspell RModeratorAttack
				message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank BravilGuards >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank BrumaGuardFaction >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank CheydinhalGuardFaction >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank ChorrolGuardFaction >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank ImperialLegion >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank ImperialLegionBattlemage >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank ImperialLegionOutside >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank ImperialWatch >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank KvatchGuards >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank LeyawiinGuards >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
				if (target.GetFactionRank SkingradGuardFaction >=0)
				player.addspell RModeratorAttack
					message "-10 health for attacking a moderator. Self Banning Process Initiated."
			endif
end

 

The timer doesn't seam to want to work. Not granted I've hand written like 4 scripts in my time without manipulating so I might be doing something awfully wrong, but how do I get the timer to work?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...