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

Modifying a buildables script for a placeable bridge, syntax error?

broken avatar :(
Created 11 years ago
by sedozz
0 Members and 1 Guest are viewing this topic.
1,389 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 4 January 2015
Last active: 1 year ago
Posts
184
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Battlefield is giving COD the hands rn
Signature
I just spent two hours moving trees around.
×
sedozz's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
sedozz's Contact & Social Linkssedozzsedozz
I tried to modify ZK's buildables script to include just one item, a bridge that is placed down. Im already running his buildables gsc for buildable power (which is havin gissues because my map keeps starting with the power on) but i made another gsc named _buildable_beidge.gsc. I get a syntax error upon loading of the map though. If you could help me fix this script that would be fantastic! :D

Code Snippet
Plaintext
//******************************************************
// Buildable Bridge
//******************************************************
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_anim;

//////////////////////////////////
//Credits
//////////////////////////////////
/*
ZK: This script
Don Goony: knuckle_crack()
sedozz
*/
//////////////////////////////////

main()
{

level.bridge_build = 0;

thread lets_build();
}

lets_build()
{
flag_wait("all_players_connected");

players = get_players();
for(i=0;i<players.size;i++)
{
players[i].part_hud = [];
}

//the plank
plank_pick = getEnt("plank_pick", "targetname"); //plank that you pick up
plank_pick_trig = getEnt("plank_pick_trig", "targetname"); //trigger to pick up plank

plank_build = getEnt("plank_build", "targetname"); //the plank that appears when built
plank_build_trig = getEnt("plank_build_trig", "targetname"); //trigger to build plank


//part 1
thread build_part(plank_pick, plank_pick_trig, plank_build, plank_build_trig);

}

build_part(part, part_trig, place_part, place_part_trig)
{
da_guy = undefined;

place_part hide();
        place_part_trig UseTriggerRequireLookAt();
        place_part_trig SetCursorHint( "HINT_NOICON" );
place_part_trig setHintString("Parts required");

part_trig UseTriggerRequireLookAt();
part_trig SetCursorHint( "HINT_NOICON" );
part_trig setHintString("Press &&1 to pick up part");

part_trig waittill("trigger", da_guy);
part_trig delete();
part delete();

place_part_trig enable_trigger();
place_part_trig sethintstring("Press &&1 to add part");
place_part_trig setvisibletoplayer(da_guy);

for(;;)
{
place_part_trig waittill("trigger", da_guy);

if( !isDefined(da_guy.is_adding_part) )
{
da_guy.is_adding_part = true;
place_part_trig delete();
da_guy thread crack_knuckles();

da_guy waittill("part_added");

hud destroy_hud();

place_part show();

level.bridge_build = level.bridge_build + 1;

if(level.bridge_build == 1)
{
thread bridge_ready();
}
wait 1.5;
da_guy.is_adding_part = undefined;
break;
}
wait .5;
}
}

bridge_ready() //this is what runs when you add all the parts
{

wait 6;
wait 1;
}

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" );
}

primaries = self GetWeaponsListPrimaries();

gun = self GetCurrentWeapon();
ammo = self GetWeaponAmmoStock( gun );
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 SetWeaponAmmoStock( gun, ammo );
self SwitchToWeapon( gun );
self AllowLean( true );
self AllowAds( true );
self AllowSprint( true );
self AllowProne( true );
self AllowMelee( true );
self notify("part_added");
return gun;
}

 
Loading ...