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

Having trouble linking entities.

broken avatar :(
Created 10 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
1,266 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
I am having trouble with linking entities to an another entity. This is a door and a clip that opens and closes at a model. Then after that, the model will start moving. But the problem is, the door and the clip doesn't go with the model when it moves, the door and the clip just stand there after they have closed. Even if I have linked them to the model :-\.
Code Snippet
Plaintext
function()
{
clip = getent ("clip","targetname");
door = getent ("door","targetname");
model = getent ("model","targetname");
door_path2 = getent ("door_path2","targetname");
destination_1 = getent ("destination_1","targetname");
speed = 14;

clip moveto (door_path2.origin, 0.1);
door moveto (door_path2.origin, 1);

wait (1);

door enablelinkto();
door linkto ("model");

clip enablelinkto();
clip linkto ("model");
 
model moveto (destination_1.origin, speed);
}
Thanks in advance.
Last Edit: April 15, 2014, 02:18:33 pm by Ege115
Marked as best answer by Ege115 10 years ago
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
That's because this
Code Snippet
Plaintext
"model"
is a string, not the variable
Code Snippet
Plaintext
model
referencing an entity.

- Phil.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
That's because this
Code Snippet
Plaintext
"model"
is a string, not the variable
Code Snippet
Plaintext
model
referencing an entity.

- Phil.
Oh, of course.

So I just remove the tokens "" at the line were I link them?

Post Merge: April 15, 2014, 02:49:54 pm
Edit: That was the problem, thank you Phil.
Last Edit: April 15, 2014, 02:49:54 pm by Ege115

 
Loading ...