Hi every one I have made my first ever script and it is very simple but I like it so if you could be nice and respect the fact that it is the first ever script i have ever made then that would help. Feel free to leave any questions or improvement suggestions i will take in to consideration.
This resource is basically a simple notification shows up at the bottom left of the screen saying welcome then your name for example WELCOM SNAKE or what every your name is in game.
NEW VERSION COMING OUT NOW
THIS WAS CODED BY @sadboilogan
HE ADVANCED MY CODE AND GAVE ME PERMISSION TO RELEASE THIS SO THANK YOU TO @sadboilogan.
May I suggest we get a separate /release/ section for these types of scripts … I mean no offense to the op but… This is really useless… Again … No offense …
Good Job on your first ever release LK_lk. In my opinion, simplicity doesn’t define usefulness. Perhaps you can build on this with some server options/bools to define different messages or rather timed messages that show the user recent Server updates, hotkeys/controls for new players etc. Basically anything you want to tell the player about your server regarding “importance” when they first join. Just a few suggestions. Again, good job and keep on learning.
Thanky you for the nice comment and yes i am going to do that I can to improve this i understand its useless but im proud as it was very hard to do as i had no experience so again thanks for the nice comment.
A few suggestions:
If you are going to add “Welcome Messages” for players that spawn into your server, it doesn’t make sense to allow the player to see the message every time they spawn. For some instances it would but since this is a “Server Welcome Message” the player should only see the message the first time they spawn in. After that it should be disabled. You should also Comment out the Console counting “Citizen.Trace(time)”, just to cleanup the Debug. If you wanted you could even break out of the while loops after the message completes considering they will never get used again. (I didn’t add breaks)
You could do this to fix that:
local firstSpawn = false
AddEventHandler("playerSpawned", function(spawn)
if not firstSpawn then
local time = 0
local messagetime = 20 --Change this for how long the message should display!
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
while time < messagetime do
--Citizen.Trace(time) --Console Debug(count)
Citizen.Wait(1000)
time = time +1
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerName = GetPlayerName( PlayerId() )
while time < messagetime do
Citizen.Wait(0)
DrawText1("Welcome "..playerName..". This is a community based on 100% RP, Fail RP will be tolerated appropriately.")
DrawText2("~g~Have Fun!")
firstSpawn = true
end
end
end)
end
end)