-- LUA Script - precede every function and global member with lowercase name of script + '_main' local U = require "scriptbank\\utillib" local Q = require "scriptbank\\quatlib" local rad = math.rad local deg = math.deg function dice_throw_init( e ) Include( "utillib.lua" ) end function dice_throw_main( e ) -- get new Euler angles local xa, ya, za = rad( GetEntityAngleX( e ) ), rad( GetEntityAngleY( e ) ), rad( GetEntityAngleZ( e ) ) local vx,vy,vz = U.Rotate3D(0,0,1, xa, ya, za) if vy > 0.5 then PromptLocal(e, "4") return elseif vy < -0.5 then PromptLocal(e, "3") return end vx,vy,vz = U.Rotate3D(0,1,0, xa, ya, za) if vy > 0.5 then PromptLocal(e, "6") return elseif vy < -0.5 then PromptLocal(e, "1") return end vx,vy,vz = U.Rotate3D(1,0,0, xa, ya, za) if vy > 0.5 then PromptLocal(e, "2") return elseif vy < -0.5 then PromptLocal(e, "5") return end end