Entity.GetModelWorldScale

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetModelWorldScale( )
Description:
Returns the model's world-scale in vector.
Returns: Vector
In Object: Entity
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetModelWorldScale]Entity.GetModelWorldScale [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionFinds the model's world-scale and halve it.
Used onNewerClient.png
Code
 
function ISaid( ply, text, team, death )
 
if (string.sub(text, 1, 5) == "!half") then
    local GetOldScale = ply:GetModelWorldScale( )
    local NewScale = GetOldScale / 2
    ply:SetModelWorldScale(NewScale)
end
 
end
 
OutputThe model's world scale is now the half of the original.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox