Jump to content

[Help] help me


Recommended Posts

Posted (edited)

sorry, my bad english.

--Source .1
function ClientPlayerSpawn()
setWeather(0)
end
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), ClientPlayerSpawn)
 
--Source .2
function ClientPlayerSpawn()
setWeather(0)
end
addEventHandler("onClientPlayerSpawn", getRootElement(), ClientPlayerSpawn)

What is difference of source.1 and source.2 ?

please ,explain detailed for me.

Edited by Guest
Posted

These are client side script.

I want only one person changing weather.

Maybe, When it uses getLocalPlayer(), the weather of only that person it changes?

When it uses getRootEelement (), does the weather of all people change?

Posted

no, all the things you are doing on client side script is working only for one player (client)..

2nd script will be changing weather only for client, when any player spawn

1st script should (theoretically) change weather only for the client, on that client/local player spawn

Posted

ok, better example

function localPlayerDied()
outputChatBox("you died")
end
 
function somebodyDied()
outputChatBox(getPlayerName(source)).." died")
end
 
addEventHandler("onClientPlayerWasted", getLocalPlayer(), localPlayerDied)
addEventHandler("onClientPlayerWasted", getRootElement(), somebodyDied)

save that script, run a server with it, run the script, invite somebody to your server, and try it..

you will see the difference easy :)

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