RangeR.. Posted April 10, 2015 Posted April 10, 2015 Hi, I've tried hard to fix it but couldn't. here's the code team = createTeam ( "Crim", 255, 0, 0) pick = createPickup ( 2737.56470, -1760.36755, 44.14845, 3, 1240, 1 ) function pickupr() if getTeamName(getPlayerTeam(source)) == "Crim" then local playerTeam = getPlayerTeam ( source ) setElementHealth(source, 100) else return end end addEventHandler("onPickupHit", getRootElement(), pickupr)
FlyingSpoon Posted April 10, 2015 Posted April 10, 2015 He was saying that the getPlayerTeam function output's an error, I forgot the error Quote: @Robin... - bad argument
Addlibs Posted April 10, 2015 Posted April 10, 2015 team = createTeam ( "Crim", 255, 0, 0) pick = createPickup ( 2737.56470, -1760.36755, 44.14845, 3, 1240, 1 ) function pickupr(player) if getTeamName(getPlayerTeam(player)) == "Crim" then setElementHealth(player, 100) else cancelEvent(true) return end end addEventHandler("onPickupHit", getRootElement(), pickupr)
FlyingSpoon Posted April 10, 2015 Posted April 10, 2015 [2015-04-10 12:51:04] WARNING: 5: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got pickup] [2015-04-10 12:51:04] WARNING: Bad argument @ 'getTeamName' [Expected team at argument 1, got boolean]
Addlibs Posted April 10, 2015 Posted April 10, 2015 team = createTeam ( "Crim", 255, 0, 0) pick = createPickup ( 2737.56470, -1760.36755, 44.14845, 3, 1240, 1 ) function pickupr(player) if getTeamName(getPlayerTeam(player)) == "Crim" then setElementHealth(player, 100) else cancelEvent(true) return end end addEventHandler("onPickupHit", getRootElement(), pickupr) Have you tried this?
Ryancit2 Posted April 10, 2015 Posted April 10, 2015 It worked, like you can see function doesn't have any typo or misc bug and also, Robin already posted this resource on community today.
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