Jump to content

[Help] SetElementModel


KrixLV

Recommended Posts

Hello everyone! I am new to this scripting stuff so I am looking for help. For the last few days I have been trying to make work SetElementModel and have no success. What I want this script to do is to change one vehicle to another while you are driving it. Any suggestions? Here is link to the site- https://wiki.multitheftauto.com/wiki/SetElementModel. Also here is the code I used.

addCommandHandler ( "changeveh",
    function ( thePlayer, command, newModel )
        local theVehicle = getPedOccupiedVehicle ( thePlayer )
        newModel = tonumber ( newModel )                          
        if theVehicle and newModel then                           
            setElementModel ( theVehicle, newModel )
        end
    end
)
Link to comment

You gotta read the notes beside all the code, if you're truly a beginner there's a number of things you could be doing wrong considering what certain things you know, keep trying xD
is your meta correct?
Is there spaces in your script folder/zip name?
Are you entering the command correctly? --/changeveh 411
https://wiki.multitheftauto.com/wiki/Vehicle_IDs --to find vehicle ID's.

(Server)
(Client)

When you see these 2 words on the wiki example pages, (server/client) it tells you how to place the script in your meta.
Add me to Skype if you need me to show you more.

[email protected]
Edited by Justin|X5|
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...