Jump to content

client script the first time does not start


JustDance

Recommended Posts

Help me pls :) I have a problem. client script the first time does not start... If you exit and re-enter - it works. Why?

I trigger client script (function):

addEventHandler ( "onPlayerJoin", getRootElement(),  
function() 
    triggerClientEvent ( source, "selTeam", getRootElement(), source) 
end 
); 

Link to comment

You probably did not understand me.... Its not client resource. Its client script.

core_s.lua:

addEventHandler ( "onPlayerJoin", getRootElement(),  
function() 
    triggerClientEvent ( source, "selTeam", getRootElement(), source) 
end 
); 

core_c.lua:

function sel_team(source) 
    for i = 1,20 do outputChatBox(" ") end 
    outputChatBox('lol') 
    fadeCamera(true) 
end 
addEvent("selTeam", true) 
addEventHandler("selTeam", getRootElement(), sel_team) 

meta:

<meta> 
     <script src="core_s.lua" type="server" /> 
     <script src="core_client.lua" type="client" /> 
     <file src="teams.xml" /> 
</meta> 

Link to comment

why you need a trigger for that? it's not needed, you can do it server side too.

addEventHandler ( "onPlayerJoin", getRootElement(), 
function() 
    for i = 1,20 do outputChatBox(" ",source) end 
    outputChatBox('lol',source) 
    fadeCamera(source,true) 
   end 
end 
); 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...