-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Hello! What I've been trying to do is create a single melee weapon model that can take on different appearances depending on what item a player has equipped in Pointshop 2. Right now, all I'm trying to do is allow them to choose between several colors of lightsaber, which will only require the skin to be edited.
It works fine for the person who is holding the saber, it always appears to be the right color in both first person and third person modes, but to anyone else who is looking at them it appears to be the default color that I specify.
local Melee = self.Owner //Code removed here because you have to pay for it. It just
//returns the name of the item in the player's "Melee" slot
if Melee == nil then
self.VElements["SaberY"].skin = 5 //The default skin, same as the starting one.
self.WElements["SaberY"].skin = 5
else
if Melee == "Red Lightsaber" then
self.VElements["SaberY"].skin = 4
self.WElements["SaberY"].skin = 4
elseif Melee == "Blue Lightsaber" then
self.VElements["SaberY"].skin = 0
self.WElements["SaberY"].skin = 0
elseif Melee == "Green Lightsaber" then
self.VElements["SaberY"].skin = 1
self.WElements["SaberY"].skin = 1
elseif Melee == "Purple Lightsaber" then
self.VElements["SaberY"].skin = 3
self.WElements["SaberY"].skin = 3
end
end
This is the code I have written to make it change skins, and as stated above it only works for the player actually holding the saber. It's located inside the SWEP:Think() function. I've thrown everything I can think of trying to get it to work, but I just can't get it. Any help you could provide would be appreciated.