Jump to content

please help fix script.


Kenix

Recommended Posts

I have made a script that when the player dies at it there is other weather but it works on all players. How to make that it worked only on one player???

server

  
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        triggerClientEvent ("playerw", getRootElement()) 
    end 
) 
  

client

  
localPlayer = getLocalPlayer() 
  
addEvent("playerw",true) 
addEventHandler( "playerw", localPlayer, 
    function( ) 
        setSkyGradient (100,50,0,70,0,0); 
    end 
) 
  

Please help to correct my script.=(

Link to comment
  • Discord Moderators

Isn't quite redundant to do this serverside if you're only going to set weather for the player?

clientside:

  
addEventHandler ('onClientPlayerWasted', root, 
    function () 
        if (source == getLocalPlayer()) then 
            setSkyGradient (100,50,0,70,0,0) 
        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...