I’ve been modding for almost a year now working on 2 main projects, TTT Assassins, and the one that I’m having trouble with, Vampirism.
In recent months I have been rewriting the mod and trying to get it to function as intended, but I keep running into issues that I can’t fix.
The main one that I’m having difficulty with is the Transformation mechanic; where a player can transform into a Vampire Lord like in Skyrim. I jumped into gmod, pressed the activation keys ([USE] + [RELOAD]) and it did the animation as well as print the message into chat like it was supposed to, but seemingly nothing else happens and I dont understand why. Perhaps someone can enlighten me?
Anyway, here’s the code:
function SWEP:Transform() self.PlayerModel = self.Owner:GetModel() self.PlayerWalkSpeed = self.Owner:GetWalkSpeed() self.PlayerSprintSpeed = self.Owner:GetRunSpeed() if CombatMode == "Beast" or CombatMode == "Blood" then return end if self.Owner:GetModel() != self.VampireModel then self.Owner:SetModel(self.VampireModel) end self.Owner:DoAnimationEvent( ACT_GMOD_GESTURE_TAUNT_ZOMBIE ) self.Owner:SetModelScale( self.VampireScale, 2 ) if self.VampireScale > 1 then self.Owner:SetCollisionGroup( COLLISION_GROUP_PASSABLE_DOOR ) else self.Owner:SetCollisionGroup( COLLISION_GROUP_NONE ) end self.Owner:SetRunSpeed(self.VampSprintSpeed) self.Owner:SetWalkSpeed(self.VampWalkSpeed) self.Owner:ChatPrint("You have entered beast form!") IsBeast = true CombatMode = "Beast" end
What I’m expecting to happen is as follows:
-The player grows 50% bigger over 2 seconds. - They don’t
-The player gets 50% faster. - They don’t
-The player does the zombie taunt animation. - They do
-The player’s model changes to the vampire lord model. - They don’t
-The player’s collision group changes to that of a passable door (to prevent derpyness). - They don’t (because they havent gotten any bigger)
-A message appears in chat stating that they have become “The beast”. - It does.
As far as I can tell, I’m not doing anything wrong. But hey, that’s likely not the case.