Jump to content

Help! Small Bug!


Recommended Posts

Posted

-

-

CLIENT-SIDE

addEventHandler("onClientPlayerWasted", getRootElement(), 
function () 
  if source == localPlayer then 
    spawnSystem() 
    setElementHealth ( localPlayer, 100 ) 
    triggerServerEvent ( "on.death", localPlayer ) 
  end 
end) 

SERVER-SIDE

function onPlayerDeath() 
takeAllWeapons ( source ) 
end 
addEvent("on.death", true) 
addEventHandler("on.death", getRootElement(), onPlayerDeath)) 

When I spawn as a new character, my health is still 0 and I am basically dead, why?

Posted
Nothing still happens.

You need to use i think you are trying to use setElementPosition()

spawnPlayer ( ) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Well I changed it a little,

CLIENT-SIDE

function spawnSystem() 
--- 
addEvent("openGUI", true) 
addEventHandler("openGUI", getRootElement(), spawnSystem) 

SERVER-SIDE

function onDeath() 
  triggerClientEvent(source, "openGUI", source) 
  takeAllWeapons ( source ) 
end 
addEventHandler("onPlayerWasted", getRootElement(), onDeath) 

Doesn't open GUI when I died?

Posted
function onDeath() 
  triggerClientEvent(source, "openGUI", source) 
  takeAllWeapons ( source ) 
  setElementHealth ( source, 100 ) 
end 
addEventHandler("onPlayerWasted", getRootElement(), onDeath) 

Posted
Still doesn't open GUI.

Post your code here

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

CLIENT-SIDE

function spawnSystem() 
--- 
addEvent("openGUI", true) 
addEventHandler("openGUI", getRootElement(), spawnSystem) 

SERVER-SIDE

function onDeath() 
  triggerClientEvent(source, "openGUI", getRootElement()) 
  takeAllWeapons (source) 
end 
addEventHandler("onPlayerWasted", getRootElement(), onDeath) 

 

 

Posted

as Walid told you, do you find this?

--SERVER 
function onDeath() 
    local my_position = {getElementPosition( source )}; 
    local playerSpawn = setTimer(spawnPlayer, 2000, 1, source, unpack(my_position) ); 
    if playerSpawn then 
       triggerClientEvent(source, "openGUI", source); 
       takeAllWeapons ( source );       
    end 
end 
addEventHandler("onPlayerWasted", getRootElement(), onDeath) 

-- CLIENT 
function spawnSystem() 
outputChatBox("I am respawning") 
end 
addEvent("openGUI", true) 
addEventHandler("openGUI", getRootElement(), spawnSystem) 

otherwise I tried your code with outputs and it works perfectly. i don't know but it might be your spawnSystem function

Inactivo.

Posted

Guys i already helped him via PM .

@raysmta next time try to write resolved ; fixed something like that.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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