Page 1 of 1
[REQUEST] No Throwing (script)
Posted: Thu Apr 01, 2021 6:40 pm
by Mighty Spirit the 2
This is another script that is seemingly impossible to find. Like the title suggest its a script where when you throw your weapon it will leave your hand for just a few ms and then disappear. You will automatically regain the weapon you tried to throw. I saw it used in one or two severs a while ago. Still for some reason it doesn't exist on Workshop. This is a script that can be useful for a number of reasons. If someone has it please send it to me or better post it on Workshop.
Re: [REQUEST] No Throwing (script)
Posted: Sat Aug 20, 2022 10:01 pm
by Mighty Spirit the 2
Yeah, so i decided to just post this on here anyway, in-case someone ever comes looking for this (whatever reason may be).
Script was originally made for me by Sree in 2021.
If you know what your doing you could replace timer trigger with Events.UpdateCallback.Start(). I'm just posting the original file.
Code: Select all
/*
* author: Mighty Spirit the 2.
* description: Script that removes Throwing, except throwable.
*/
public void OnStartup()
{
IObjectTimerTrigger Timer0 = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
Timer0.SetIntervalTime(1);
Timer0.SetRepeatCount (0);
Timer0.SetScriptMethod("NoThrow");
Timer0.Trigger();
Game.RunCommand("/MSG No Throwing");
}
public void NoThrow(TriggerArgs args)
{
foreach(IPlayer ply in Game.GetPlayers())
{
if(ply.IsThrowing && ply.CurrentWeaponDrawn != WeaponItemType.Thrown)
{
ply.RemoveWeaponItemType(ply.CurrentWeaponDrawn);
}
}
}
Re: [REQUEST] No Throwing (script)
Posted: Sat Oct 22, 2022 6:06 pm
by phantom
So, do you want a custom script or not?
And also that script you posted seems that it would only remove the thrown weapon but not give it back.
EDIT: I modified your script and it works like a charm
Code: Select all
// No Throwing
// By Phantom :)
public void AfterStartup()
{
Game.ShowChatMessage("No Throwing", Color.Red);
Events.UpdateCallback.Start(OnUpdate, 10);
}
public void OnUpdate(float elapsed)
{
foreach (IPlayer ply in Game.GetPlayers())
{
if (ply.InThrowingMode)
{
var temp = ply.Disarm(ply.CurrentWeaponDrawn);
temp.Remove();
ply.GiveWeaponItem(temp.WeaponItem);
}
}
}
Re: [REQUEST] No Throwing (script)
Posted: Sat Nov 05, 2022 2:39 am
by Mighty Spirit the 2
phantom wrote: ↑Sat Oct 22, 2022 6:06 pm
So, do you want a custom script or not?
I posted my script because i don't have any interest in the game anymore (or anything else in my life for that matter), and just wanted others to be able to enjoy it if they wished.
I haven't tried your script, but the removal of the weapon was kind off the entire point. Back then i was in a totally different state of mind going for the extreme level of competitive that was unheard of at the time and will never be matched again by any sane player, the concept was: You throw your weapon = you loose it. That's it, no spam, no mercy. And also i noticed how your script doesn't return previous gun ammo or melee wpn durability in the coding. This means you can just enter throw mode anytime and get back a brand new weapon, no need to ever drop bazooka or GL again i'm guessing?
Re: [REQUEST] No Throwing (script)
Posted: Sun Nov 06, 2022 2:46 pm
by phantom
Mighty Spirit the 2 wrote: ↑Sat Nov 05, 2022 2:39 am
I noticed how your script doesn't return previous gun ammo or melee wpn durability in the coding. This means you can just enter throw mode anytime and get back a brand new weapon, no need to ever drop bazooka or GL again i'm guessing?
Sorry, I didn't thought that I just tested it with all weapons in map editor.
Re: [REQUEST] No Throwing (script)
Posted: Sun Nov 06, 2022 10:01 pm
by Mighty Spirit the 2
phantom wrote: ↑Sun Nov 06, 2022 2:46 pm
Sorry, I didn't thought that I just tested it with all weapons in map editor.
That's not your fault, that's mine. I changed my mind later without updating what i wrote originally.
For my Original post, what you coded was pretty much what i asked for.
