[How-To] Create a basic script

It’s okay. I would’ve gotten it solved sooner if I would’ve noticed the miss-type the first time. lol

Yep lol but it still dont work

I ahve fixed it now nevermind

i cant find my resources folder in the new fivem, also when the script is made how do i test it

I was wondering if there was a way I could add a line in the script so it would read a players name when he joins the server and then it would print it in the “Hello World” message? Like It would be “Welcome “name of player” to our server”.

is the print message local or does it announce it to the server

It’s not in FiveM, it’s in your server folder.

Use GetPlayerName(playerSource)

On a client script, it outputs it to the client’s log file and the F8 client console.
A sever script would output this to the server console/log.

Is this script still working as I can’t seem to get it to send a message to me when I load into the server as it should be doing. The F8 is just showing that failed to load client.lua.

client.lua

__resource.lua

Can anyone see where I’m going wrong or is this just out dated now?

@pongo1231 how would i use the blip natives)to set (multiple blips, selectable) on the map, with custom names, and blip icons? (icon ids here: https://wiki.■■■■■■■■■■■/index.php?title=Blips ) what i have so far (don’t know if it works: AddEventHandler("playerSpawned", function(spawn) TriggerEvent(AddBlipForCoord(1016.9416116504883, -1445.259153077819, 23.51)) -- Post Oost - Gezamenlijk end)

Use TriggerEvent instead.

Could someone explain how to make a “Standard” GTA GUI?

I saw something like Native UI but i dont know how to use it.

c:

I am a bit new to lua but I have been working with web based code for a while. Would it be possible to run a command that would then bring up a GUI of my website? It would be almost like an html Iframe.

How do I put this on my server?
Screenshot_2

That seems to use DrawText, Here is an example script usage of it:

DrawText(“I’ve got the sauce, no ketchup ”)

function DrawText(text) —It DRAWS the string
        SetTextFont(0)
        SetTextProportional(1)
        SetTextScale(0.0, 0.45)
        SetTextDropshadow(1, 0, 0, 0, 255)
        SetTextEdge(1, 0, 0, 0, 255)
        SetTextDropShadow()
        SetTextOutline()
        SetTextEntry("STRING")
        AddTextComponentString(text)
        DrawText(0.174, 0.855) —Draws the text by the value of (x, y) min = (0,0) max = (1,1)
    end

Is this tutorial still valid? I’ve tried it and it isn’t working, I need to know if I’m the idiot or if this code is out of date.

I’ve substituted the citmp-server.yml with server.cfg.

Should still work.

Was chatmessage instead of chatMessage, I’m so rusty. :rofl:

citmp-server.yml becomes server.cfg.
and
AutoStartResources becomes start FolderName.

uhm no?
The event is called chatMessage, not chatmessage

Or did you try chatmessage in your script instead of chatMessage?

Yea, I typed it wrong.

I need help scripting