AddEventHandler('chatMessage', function(source, n, message)
command = stringsplit(message, " ")
if(command[1] == "/help") then
CancelEvent()
--put what you want here
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
AddEventHandler(‘chatMessage’, function(source, n, message)
command = stringsplit(message, " ")
if(command[1] == “/help”) then
CancelEvent()
TriggerClientEvent(‘chatMessage’, source, …name, {255, 0, 0}, “hello”)
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = “%s”
end
local t={} ; i=1
for str in string.gmatch(inputstr, “([^”…sep…"]+)") do
t[i] = str
i = i + 1
end
return t
end
AddEventHandler('chatMessage', function(source, n, message)
command = stringsplit(message, " ")
if(command[1] == "/help") then
CancelEvent()
TriggerClientEvent('chatMessage', source, ..name, {255, 0, 0}, "hello")
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
AddEventHandler('chatMessage', function(source, n, message)
command = stringsplit(message, " ")
if(command[1] == "/help") then
CancelEvent()
TriggerClientEvent("chatMessage", source, n, {255, 0, 0}, "hello")
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
you had .. which was unnecessary and at the top you can see AddEventHandler('chatMessage', function(source, n, message) which you had name instead of just n in your chatmessage event
Ah ok thanks also i did ask you if you wanted to be a dev for a good community which is in developmen not ope to the public yet but i am head admin we have been working hard trying to make he community a good community and we would love it if you could dev for us as i could help dev but im not the best that way i can learn in the process of developing.
Want to promote your server, look for new players, find developers, or whatever? Go here! Make sure to adhere to the FiveM Service Agreement when posting in the Server Bazaar.
And learn how to use the edit function on your posts instead of creating two or more posts in a row.