Scripting Moderators ds1-e Posted December 29, 2018 Scripting Moderators Share Posted December 29, 2018 Hey, i need to scale weapon [which is custom object] in hands. Any ideas how can i do it? Link to comment
ShayF2 Posted December 29, 2018 Share Posted December 29, 2018 (edited) function getPlayerWeaponAsElement(player) local weaps = getElementsByType('weapon') local x1, y1, z1 = getElementPosition(player) for i=1, #weaps do local x2, y2, z2 = getElementPosition(weaps[i]) local distance = getDistanceBetweenPoints3D(x1, y1, z1, x2, y2, z2) if distance < 2 then return weaps[i] end end return false end No idea if something like this would work since the element type is weapon, not object, no way to set object scale. And even though this seems pointless, getPlayerWeapon returns the players weapon slot and not the weapon its self. What you could do is turn off visibility for the players weapon, and create an object, updating its position and rotation every frame, that way you would be able to rescale the weapon (visually that is). Edited December 29, 2018 by ShayF Link to comment
Other Languages Moderators androksi Posted December 29, 2018 Other Languages Moderators Share Posted December 29, 2018 setObjectScale Link to comment
JeViCo Posted December 30, 2018 Share Posted December 30, 2018 @majqq You can't interact with weapons directly. You should do it in common software like Zmodeller (dff) - easy way OR you can make invisible texture, create and attach custom weapon object to yourself using bone_attach functions, replace texture using shaders to make them visible again and manage it - hard way 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now