Glaudeo Posted July 4, 2020 Share Posted July 4, 2020 I want to make a character who would increase their maxhealth by +10 for each player on a server. I can search players in radius like this: local x,y,z = inst.Transform:GetWorldPosition() local radius = 6000 local players = TheSim:FindEntities(x, y, z, radius, {"player"}, {"playerghost"}) local playercount = #players But how do I apply it to maxheath change? Or maybe I can somehow know when a player join a server, so it is possible to apply +10 when player connected and -10 when player disconnected? Link to comment https://forums.kleientertainment.com/forums/topic/119775-gain-maxhealth-from-players/ Share on other sites More sharing options...
penguin0616 Posted July 5, 2020 Share Posted July 5, 2020 You can use TheWorld:ListenForEvent("ms_playerjoined") and TheWorld:ListenForEvent("ms_playerleft") to figure out when a person joins and leaves. You can use Health:SetMaxHealth(amount) to change the player's maxhealth as well. 2 Link to comment https://forums.kleientertainment.com/forums/topic/119775-gain-maxhealth-from-players/#findComment-1351036 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now