Garry's Mod

Garry's Mod

Star Wars Lightsabers
Questions about modding API
Hey Rubat.
Apologies if you have been asked this before.

So obviously, I'm running a SWRP server and I want to restrict the force powers for certain jobs.

I know I'm supposed to use the CanUseLightsaberForcePower hook and that's what I'm doing.
local Sith = { [60] = true, [61] = true, [62] = true } hook.Add( "CanUseLightsaberForcePower", "ForceUSE", function( ply, power ) if Sith[!ply:Team()] and ( power == "Sith Lightning" ) then return false end end )
Basically I'm trying to restrict all Non-Sith jobs from using the Force Lightning force power (Which i changed to Sith Lightning) I'm not sure why its not working atm and I thought that I should ask you for some advice.

Also regarding lightsaber damage
hook.Add( "CanLightsaberDamageEntity", "LightDMG", function( victim, lightsaber, trace ) return (math.Rand(100, 200)) --if ply:Team() == 54 then return (math.Rand(1, 10 )) end --elseif ply:Team() == 53 then return (math.Rand(50, 100 )) end end )
Doesn't seem to work for me either (The math.Rand part of it) Any ideas on how to fix it?
Last edited by CyberiumShadow; 3 Sep, 2016 @ 9:37am
< >
Showing 1-6 of 6 comments
Rubat  [developer] 3 Sep, 2016 @ 9:45am 
Please learn to code before asking questions here.

As for the second one, I will look into it.
CyberiumShadow 4 Sep, 2016 @ 6:56am 
Originally posted by Rubat:
Please learn to code before asking questions here.

As for the second one, I will look into it.

Thank you for considering the second point I made.

EDIT: I have figured out how to use the force power hook. Now its just lightsaber damage that I am trying to figure out.
Rubat  [developer] 4 Sep, 2016 @ 7:14am 
There some major problems with the code for that hook that I will need to take care of before you can use that hook. My apologies for that, I will be releasing an update soon.
CyberiumShadow 4 Sep, 2016 @ 9:01pm 
Originally posted by Rubat:
There some major problems with the code for that hook that I will need to take care of before you can use that hook. My apologies for that, I will be releasing an update soon.

Thanks Rubat.
Rubat  [developer] 6 Sep, 2016 @ 6:19am 
Update that fixes that hook will come within an hour.
CyberiumShadow 6 Sep, 2016 @ 11:44pm 
Cheers
< >
Showing 1-6 of 6 comments
Per page: 1530 50