Jump to content

Spawnare cu un skin.


Richy

Recommended Posts

E destul de simplu. Creezi o functie, si atasezi un eventHandler la ea. Am sa fac un script ca sa intelegi mai bine.

  
local theSkin = 200 -- IDul skinului care va fi setat cand jucatorul se spawneaza. 
  
function setSkinOnSpawn() 
if(theSkin) then -- Ne asiguram ca ai configurat skinul, in caz contrar aratam o eroare. 
setElementModel(source, theSkin) -- Functia care face toata 'magia' 
else 
outputChatBox("Nu ai introdus un ID pentru noul skin!", source, 255, 0, 0) -- 255, 0, 0 = Rosu - 255, Verde - 0, Albastru - 0 
end 
end 
addEventHandler("onPlayerSpawn", root, setSkinOnSpawn) -- Eventul 'onPlayerSpawn' va fi chemat pentru orice element care se spawneaza, si va apela functia setSkinOnSpawn. 
  

source = Sursa eventului chemat (elementul responsabil).

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...