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

Shootable EE Problem

broken avatar :(
Created 7 years ago
by Deminate
0 Members and 1 Guest are viewing this topic.
1,814 views
broken avatar :(
×
broken avatar :(
Location: usOhio
Date Registered: 25 August 2016
Last active: 6 years ago
Posts
16
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
(Professional Whining Bitch)
Signature
https://gyazo.com/93315dd4d3fef896f930a9c88ad95026" width="958
×
Deminate's Groups
Deminate's Contact & Social Linksfirefromfrenchfryff1225GameForCHEEZDeminate
So i have a little shootable easter egg teddy on my map. I can shoot it, and everything works. But the model will not delete. Please tell me what im doing wrong (the script isn't very good since im new to scripting).

Code Snippet
Plaintext
function moneyteddy()
{
trigger = GetEnt("money_ted","targetname");
trigger SetHintString("");
trigger SetCursorHint("HINT_NOICON");
teddyModel = GetEnt("ted_model","targetname");
MoneyGiven = 1000;

while(1)
{
trigger waittill("trigger",player);
player zm_score::add_to_player_score(MoneyGiven);
player playLocalSound("zmb_cha_ching");
trigger delete();
teddyModel hide();

}

}

I have also tried teddyModel delete();
Marked as best answer by Deminate 7 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
So i have a little shootable easter egg teddy on my map. I can shoot it, and everything works. But the model will not delete. Please tell me what im doing wrong (the script isn't very good since im new to scripting).

Code Snippet
Plaintext
function moneyteddy()
{
trigger = GetEnt("money_ted","targetname");
trigger SetHintString("");
trigger SetCursorHint("HINT_NOICON");
teddyModel = GetEnt("ted_model","targetname");
MoneyGiven = 1000;

while(1)
{
trigger waittill("trigger",player);
player zm_score::add_to_player_score(MoneyGiven);
player playLocalSound("zmb_cha_ching");
trigger delete();
teddyModel hide();

}

}

I have also tried teddyModel delete();

When making shootable's you should make the trigger or the model the target of the other. For instance, if you delete the targetname of the teddy, and deselect it. Then select the trigger, and then select the teddy again, and then press w, it will setup a auto#.

This will prevent you from having multiple entities with the same kvp, which is possibly what is happening here, or you have a typo, or your teddy isn't a script_model. You then would modify your script as such:
Code Snippet
Plaintext
function moneyteddy()
{
trigger = GetEnt("money_ted","targetname");
trigger SetHintString("");
trigger SetCursorHint("HINT_NOICON");
MoneyGiven = 1000;

trigger waittill("trigger",player);
player zm_score::add_to_player_score(MoneyGiven);
player playLocalSound("zmb_cha_ching");
teddyModel = GetEnt(trigger.target,"targetname");
trigger delete();
teddyModel delete();
}

If there will only be one teddy, then this is fine, but if multiple teddies were to be used, I would start modifying this script like this:
Code Snippet
Plaintext
function moneyteddy()
{
triggers = GetEnt("money_ted","targetname");
array::thread_all(triggers, &MoneyTeddyGive);
}
function MoneyTeddyGive(){
self SetHintString("");
self SetCursorHint("HINT_NOICON");
MoneyGiven = 1000;

while(1){
self waittill("trigger",player);
if(IsPlayer(player)){
player zm_score::add_to_player_score(MoneyGiven);
player playLocalSound("zmb_cha_ching");
break;
}
}
teddyModel = GetEnt(self.target,"targetname");
teddyModel delete();
self delete();
}


On a side note, you say your making a shootable ee, but your setting up a hintstring?
Last Edit: November 27, 2016, 04:06:52 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: usOhio
Date Registered: 25 August 2016
Last active: 6 years ago
Posts
16
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
(Professional Whining Bitch)
×
Deminate's Groups
Deminate's Contact & Social Linksfirefromfrenchfryff1225GameForCHEEZDeminate
Oh i thought hintstrings were required lol. Thanks for your help too.

Double Post Merge: November 27, 2016, 11:29:02 pm
Oh and also are you saying that the script should work, but i mispelled or did something in radiant wrong?

Double Post Merge: November 27, 2016, 11:56:54 pm
OH MY GOD IM STUPID. I made a misc model, not a script model... derp :/
Last Edit: November 27, 2016, 11:56:54 pm by Deminate

 
Loading ...