Jump to content

[Question] Race Spectator


chris1384

Recommended Posts

Posted

Hi there! I'm working at the race resource and I was wondering if I can get the spectator target's health and nitro and other elements data (like.. I'm spectating a player and I want to know how much nitro he has left). Is it possible? And how?

Posted (edited)

Getting a vehicle health when using setCameraTarget on a different player I meant, not from localPlayer. :D

Nevermind, solved

Edited by chris1384
Posted (edited)

I did not test.
 

--ClientSide
function getStatusCamera()
	local spec = getCameraTarget()
  	local veh =  getVehicleOccupant(spec)
	if (getElementType(spec) == "player") then 
		getElementHealth(veh)
		getVehicleNitroLevel(veh)
    end
end

 

Edited by Tommy.
I forgot to put the vehicle :v
  • Thanks 1

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