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 Script

broken avatar :(
Created 11 years ago
by Linoxet
0 Members and 1 Guest are viewing this topic.
1,789 views
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
[Sorry for my bad english] Hi! I've been learning to create custom maps and im trying to do a script (I am really new to scripting, i have a little experience with c#), here is what im trying to do:

I've made a shootable that opens up a "poster" with a custom textures, its working fine.
But I was trying to "move" a trigger to the same location as the poster, and when player press use button, it decreases his points by 2000 and give him a thompson (I've "customized" the thompson").

Here is what I was trying (I'm very new to gsc)

Code Snippet
Plaintext
zone3_door()
{
trigger = getEnt("zone3_shootme", "targetname"); //this is the trigger to shoot
model = getEnt("zone3_shootme_model", "targetname"); //the model that moves when u shoot
door1 = getEnt("zone3_shootme_door1", "targetname"); //left side of a door
door2 = getEnt("zone3_shootme_door2", "targetname"); //right side of a door
doors1 = getEnt("so7door1", "targetname"); //another door
doors2 = getEnt("so7door2", "targetname"); //another door
doors3 = getEnt("so7door3", "targetname"); //another door
trigger2 = getEnt("feedso7", "targetname"); //the trigger that "moves" when shoot


trigger waittill("trigger");
trigger delete();
play_sound_at_pos("door_slide_open", model.origin);
play_sound_at_pos("door_slide_open", door1.origin);
door1 MoveX (-64, 2);
door2 MoveX (64, 2);
model MoveY (-20, 2);
doors1 MoveY (-64, 3);
doors2 MoveY (64, 3);
doors3 MoveZ  (-144, 5);
trigger2 MoveX (56, 2);
iprintln("Portuguese words lalala"); //until here it's working w/ no problems

trigger2 waittill("trigger", player); //trigger that moved waiting to be activated
trigger2 setCursorHint( "HINT_NOICON" );
trigger2 SetHintString("Pressione &&1 para comprar a melhor arma ever : 2 Barao"); //press f to ...
cost = 2000; //cost
if ( player.score < cost )
{
player iprintln("POBREZINHO NA MADRUGS HEIN"); //tell him not enough cash
self playsound("deny");
}
trigger2 delete();
player maps\_zombiemode_score::minus_to_player_score( cost );  //decrease his score
player playlocalsound("laugh_child"); //sound
player giveweapon( "zombie_thompson" );


wait 1;

}

When i start the game it give's me a lot of error, BUT it "works", all the walls move, and if I press F it give me a thompson and decreases my points.
- the hud is not showing, it's only showing a hand

AND sometimes it just works perfectly fine, without any error, but still with the "hand"...

Really sorry for bad english and for "long" post  :P
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
youve got a waittill trigger after another waittill trigger in the same loop
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
I tried to "separate" these two triggers but still no text, just the hand icon...
And how can I "detect" how many weapons the player have? Like, if he have 2 weapons, take his current weapon...

Thanks for the help anyway :D
[Sorry for bad english :q]
Marked as best answer by Linoxet 11 years ago
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
Im not at my PC so cant see the script reference

Id recommend looking at the laststand.gsc

theres functions for taking, and returning the weapons for last stand

thatll have what you need, have a quick read of that

 
Loading ...