Giter Club home page Giter Club logo

mka-lasers's People

Contributors

mkafrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mka-lasers's Issues

if playerBeingHit then SetPlayerWantedLevel

So I got the lasers working and they are so cool, now im trying to add a function to just add

        SetPlayerWantedLevel(playerId, 4, false)
        SetPlayerWantedLevelNow(playerId, false)

to set a wanted level on player hit.
I tried this to no avail.

CreateThread(function()
if playerBeingHit then
local playerId = PlayerId()
SetPlayerWantedLevel(playerId, 4, false)
SetPlayerWantedLevelNow(playerId, false)
-- Laser just hit the player
else
-- Laser just stopped hitting the player
-- hitPos will just be a zero vector here
end
end)

I know you've answered this before

Im having a terrible time getting the lasers to active period .

  • Ive been able to create a lazer , and its produced into the lazer.txt document

  • From here im a little lost ('@mka-lasers/client/client.lua',
    'your_scripts_client.lua', ) am i dropping both of these into the lets say for example BankHeist Fxmanifest ?

  • If so awesome im on the right track

  • Now the whole laser.active(true) where is that going ? do i take the part of code from the Lazer.txt file add it into the BankHeist Client side then add laser.active .

Example

-- Name: legionbank | 2021-12-09T21:25:31Z
Laser.new()
vector3(147.805, -1046.457, 28.597),
{vector3(148.751, -1044.211, 28.471)},
{travelTimeBetweenTargets = {1.0, 1.0}, waitTimeAtTargets = {0.0, 0.0}, randomTargetSelection = true, name = "legionbank"}
)

Where would i add the extra getactive , get color , etc . maybe by any chance can you release a quick video of you creating a laser ?

thanks

Still errors (Native Changes)

So with the latest commit you need to just Invoke the native as the names have changed (Im assuming) for StartShapeTestRay, StartExpensiveSynchronousShapeTestLosProbe and GetShapeTestResult

local function RayCast(origin, destination, flags)
  local ray = Citizen.InvokeNative(0x377906D8A31E5586, origin.x, origin.y, origin.z, destination.x, destination.y, destination.z, flags, nil, 0)
  return Citizen.InvokeNative(0x3D87450E15D9869, ray)
end

This still is causing issues with playerhit detection and returning everything as nil in your _onPlayerHitTest

local _, hit, hitPos, _, hitEntity = RayCast(origin, destination, 12)

How to trigger lasers?

Hey, I don't really know alot about scripting and I don't understand how to trigger the lasers. Can you give me an example?

Call setActive(true)

Can you make a example where you call setActive(true) I got only errors when I try to turn them on. Attempt to call nil value (field 'setActive'). I've tried Lazer.setActive(true), self.setActive(true) and setActive(true). My fxmanifest is ok and i have imported the lasers to my client file.

mka-lasers not starting

Hi mkafrin

I have recently tried to use this script to add an extra layer of fun to my qb-bankrobbery but cant seem to get lasers to be visible or active we have tried mutiple variations of how to get it working and still cant figure it out please see below the code we are using at the bottom of our qb-bankrobbery file. Cheers for any help on the matter

Jason

//qb-bankrobbery coding//
-- Name: PaletoVault | 2022-06-21T09:47:42Z
local laser = Laser.new(
vector3(-101.272, 6467.252, 31.888),
{vector3(-104.084, 6464.408, 31.908)},
{travelTimeBetweenTargets = {1.0, 1.0}, waitTimeAtTargets = {0.0, 0.0}, randomTargetSelection = true, name = "PaletoVault"}
)
-- Using methods on laser (in this case, calling setActive(true), which turns on the laser)
laser.setActive(true)

Add onHit/onCollision to lasers

Should work like onPlayerInOut in PolyZone. Basically takes a callback that is triggered whenever the player is hit by the laser.

setActive step creates error

I have completed the previous steps in the readme file. Also put Laser.new() in my client file. But when I try to call setActive(true) in the same lua file as my script is supposed to activate the lasers, all I get is an error:
SCRIPT ERROR: @vaultrobbery/client:53: attempt to call a nil value (field 'setActive')

Hopefully I imported the script correctly. Followed your steps and put @ before the mentioned, which I assume means it import any folder in the resource folder(?) and doesnt have to be inside my vaultrobbery folder

nvm

I'm trying to make this work.
I made a laser named 'testlaser'
Do I need to activated it with 'testlaser.setActive(true)' or 'Laser['testlaser'].setActive(true)' or ?
I can't seem to figure it out

Lasers not showing

Hey I found you from nopixel as developer and I seen you're using lasers in the big vault I wanted to try it out and I created my lasers and I followed your steps and it was not showing i created new resource with _resource.lua and put the client script code and i pasted the generated code to another file client.lua and when i run server it not showing.

Multiple origin points

Add the ability to have multiple origin points. This will enable scenarios where you have the origin and target moving, like a horizontal laser that moves back and forth along the wall.

lasers.onplayerhit not working

hello i used this code in here and it says its not working and idea why?

CreateThread(function()
	while true do
		Laser.onPlayerHit(function(playerBeingHit, hitPos)
			if playerBeingHit then
				QBCore.Functions.Notify('1', 'error', 7500)
				print("True")
			else
				-- Laser just stopped hitting the player
				-- hitPos will just be a zero vector here
			end
		end)
	end
end)

--edit nvm i got it working

onPlayerHit error

When using onPlayerHit Function it returns StartShapeTestRay as nil

Laser's Active but not visible

when running through where the lasers have been setup its printing "person hit" as expected
however there are no lasers visible

FIX: REMOVED use_experimental_fxv2_oal 'yes' FROM MANIFEST

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.