Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Need help i need to know a code/module of a vehicle??

Asked by 2 years ago

i need help how to know the module/code of a vehicle so i can set it into a script i need help???

just if I want to sat in my script spawn car x how can I type into the script to say spawn car x and not car y

this is an example. Im am a beginner

1 answer

Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

You can make a type variable in a module if you are using tables, example scripts:

Normal script:

local Stuff = require("Yeah")
local NewThing = Stuff.New("What123")

if NewThing.Type == "What123" then
    -- Yeah, your code
end

Module script:

local Stuff = {}

Stuff.New = function(_type)
    local newStuff = {}
    newStuff.Type = _type -- We are giving a variable named "Type" to the "new stuff"

    return newStuff
end

return Stuff
Ad

Answer this question