I'm trying to make a traitor gun that swaps the names, models, positions, and health of two players. Currently the health and position change, but I haven't been able to find a good way to change their model and name. Since the disguiser changes name, there must be a way to do it.
local otherPlayer = self.Owner:GetEyeTrace().Entity
if ( IsValid( otherPlayer) and otherPlayer:IsPlayer()) then
myInfo = {}
myInfo["health"] = self.Owner:Health()
myInfo["pos"] = self.Owner:GetPos()
myInfo["model"] = self.Owner:GetModel()
myInfo["name"] = self.Owner:GetName()
otherInfo = {}
otherInfo["health"] = otherPlayer:Health()
otherInfo["pos"] = otherPlayer:GetPos()
otherInfo["model"] = otherPlayer:GetModel()
otherInfo["name"] = otherPlayer:GetName()
self.Owner:SetHealth(otherInfo["health"])
self.Owner:SetPos(otherInfo["pos"])
self.Owner:SetModel(otherInfo["model"])
self.Owner:SetName(otherInfo["name"])
otherPlayer:SetHealth(myInfo["health"])
otherPlayer:SetPos(myInfo["pos"])
otherPlayer:SetModel(myInfo["model"])
otherPlayer:SetName(myInfo["name"])
end
Sorry, you need to Log In to post a reply to this thread.