Jump to content

Am I dumb?


Recommended Posts

  • Moderators
Posted

Server side load before client side.

You need to wait, until client side load.

 

outputChatBox("Test") -- good

addEvent("trig1", true)
addEventHandler("trig1", root, function()
    outputChatBox("trig111")
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
	triggerServerEvent("onClientSideStarted", resourceRoot)
end)
addEvent("onClientSideStarted", true)
addEventHandler("onClientSideStarted", resourceRoot, function()
	triggerClientEvent(root, "trig1", root, var1)
end)

 

Posted
6 minutes ago, stPatrick said:

Server side load before client side.

You need to wait, until client side load.

 


outputChatBox("Test") -- good

addEvent("trig1", true)
addEventHandler("trig1", root, function()
    outputChatBox("trig111")
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
	triggerServerEvent("onClientSideStarted", resourceRoot)
end)

addEvent("onClientSideStarted", true)
addEventHandler("onClientSideStarted", resourceRoot, function()
	triggerClientEvent(root, "trig1", root, var1)
end)

 

is now being sent, but the error is still showing up and I want it to be without error in db3

 

  • Moderators
Posted
6 minutes ago, NoviceWithManyProblems said:

is now being sent, but the error is still showing up and I want it to be without error in db3

 

Something else is doing it.

  • Moderators
Posted
28 minutes ago, NoviceWithManyProblems said:

is now being sent, but the error is still showing up and I want it to be without error in db3

That is because it is also send to players that didn't load the resource.

Instead, send it right back to the sender: client


addEvent("onClientSideStarted", true)
addEventHandler("onClientSideStarted", resourceRoot, function()
	triggerClientEvent(client, "trig1", root, var1)
end)

 


 

See also this tutorial/enchantment, it does error handling for you as well as providing things like callbacks:

 

  • Like 2

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...