This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function CallScaleformMethod(scaleform, method, ...) --? i dont remember where i stole this function from but, credit to them lol | |
local t | |
local args = { ... } | |
BeginScaleformMovieMethod(scaleform, method) | |
for k, v in ipairs(args) do | |
t = type(v) | |
if t == 'string' then | |
PushScaleformMovieMethodParameterString(v) | |
elseif t == 'number' then | |
if string.match(tostring(v), "%.") then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- usage: local hit, endCoords, surfaceNormal, entityHit, entityType, direction = ScreenToWorld(flags, toIgnore) | |
function ScreenToWorld(flags, toIgnore) | |
local camRot = GetGameplayCamRot(0) | |
local camPos = GetGameplayCamCoord() | |
local posX = GetControlNormal(0, 239) | |
local posY = GetControlNormal(0, 240) | |
local cursor = vector2(posX, posY) | |
local cam3DPos, forwardDir = ScreenRelToWorld(camPos, camRot, cursor) | |
local direction = camPos + forwardDir * raycastLength |