UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Help with custom script for Buried Chalk

broken avatar :(
Created 12 years ago
by Dust
0 Members and 1 Guest are viewing this topic.
2,948 views
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Okay so i wrote up a very basic script for the buried chalk, where the player can choose where they want the weapon to go, everything works, but how do i make it to where the players can pick the spot? right now i got it set up to where the players has to be at a specific spot to place the gun, then the trigger gets enabled. But not sure how to make it so the player can pick the spot. here is my script

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{
  thread kar98k_chalk();
}
//Kar98k Chalk
kar98k_chalk()
{
    da_guy = undefined;
    kar98k = getent( "kar98k", "target" );
kar98k setCursorHint( "HINT_NOICON" );
kar98k disable_trigger();
kar98k_build = getent( "kar98k_build", "targetname" );
kar98k_build setCursorHint( "HINT_NOICON" );
kar98k_build sethintstring ("Press and Hold &&1 to Build Kar98k Chalk");
kar98k_build disable_trigger();
    trigger = getent( "kar98k_test", "targetname" );
trigger setCursorHint("HINT_NOICON");
trigger sethintstring("Press &&1 to Pick up Kar98k Chalk");
trigger waittill ("trigger");
trigger delete();


    kar98k_build enable_trigger();
    kar98k_build waittill("trigger");
if( !isDefined(da_guy.is_adding_part) )
{
da_guy.is_adding_part = true;
kar98k_build delete();
da_guy thread crack_knuckles();

da_guy waittill("part_added");
wait 1.5;
kar98k enable_trigger();
da_guy.is_adding_part = undefined;
}
}

crack_knuckles()
{
self DisableOffhandWeapons();
self DisableWeaponCycling();

self AllowLean( false );
self AllowAds( false );
self AllowSprint( false );
self AllowProne( false );
self AllowMelee( false );

if ( self GetStance() == "prone" )
{
self SetStance( "crouch" );
}

gun = self GetCurrentWeapon();
weapon = "zombie_knuckle_crack";
self GiveWeapon( weapon );
self SwitchToWeapon( weapon );
self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
self EnableOffhandWeapons();
self EnableWeaponCycling();
self GiveWeapon( gun );
self SwitchToWeapon( gun );
self AllowLean( true );
self AllowAds( true );
self AllowSprint( true );
self AllowProne( true );
self AllowMelee( true );
self notify("part_added");
return gun;
}


Note this is my first time at writing a custom script so i know some stuff may look weird.
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
make it a case statement is the easiest option.
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
is there a basic tutorial for these different statements? never messed around with case statements
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
the way I would have done it would be have all the drawable weapon triggers off the map. (ones you find in your zombiemode prefabs). then when the players draws on a questionmark, set the origin of the gun the chalk represents, to that questionmark
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
this is how a case statement is:
Code Snippet
Plaintext
var = undefined; //the variable has to be set before the actual script i chose to make it undefined

switch(var){ // var is the variable
  case "1": // what the first option the variable could be

  break; // how to end a case
 
  case "2": // what the second option the variable could be

  break;
}
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
the way I would have done it would be have all the drawable weapon triggers off the map. (ones you find in your zombiemode prefabs). then when the players draws on a questionmark, set the origin of the gun the chalk represents, to that questionmark

That sounds pretty easy, will try this later.

Also n1 thanks for that case statement, will mess around with that later and see what i can come up with
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
welcome. remember to NOT include me in any credits for any help i give
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
the way I would have done it would be have all the drawable weapon triggers off the map. (ones you find in your zombiemode prefabs). then when the players draws on a questionmark, set the origin of the gun the chalk represents, to that questionmark

Okay, sorry for my noobiness but how do i set the origin of the gun to the question mark that the players draw on
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
I would make script_origins in your question mark prefab to represent destination origins and angles
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
listen to him. he knows all

 
Loading ...