Garry's Mod

Garry's Mod

Star Wars Lightsabers
CyberiumShadow 2016 年 9 月 3 日 上午 9:35
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?
最后由 CyberiumShadow 编辑于; 2016 年 9 月 3 日 上午 9:37
< >
正在显示第 1 - 6 条,共 6 条留言
Rubat  [开发者] 2016 年 9 月 3 日 上午 9:45 
Please learn to code before asking questions here.

As for the second one, I will look into it.
CyberiumShadow 2016 年 9 月 4 日 上午 6:56 
引用自 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  [开发者] 2016 年 9 月 4 日 上午 7:14 
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 2016 年 9 月 4 日 下午 9:01 
引用自 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  [开发者] 2016 年 9 月 6 日 上午 6:19 
Update that fixes that hook will come within an hour.
CyberiumShadow 2016 年 9 月 6 日 下午 11:44 
Cheers
< >
正在显示第 1 - 6 条,共 6 条留言
每页显示数: 1530 50