Citizen.CreateThread(function()
while true do
Wait(0)
if IsControlJustPressed(1, 38) then
TaskStartScenarioInPlace(player, "WORLD_HUMAN_STAND_FISHING", 0, false)
end
end
end)
would start the anim on keypress without an event.
I didn’t put my entire code in here, of course if player pressed E is an expression… I have the actual code in my script. I didn’t know tasks didn’t require client / server interaction sorry guys and thanks for the heads up @everyone
Only if the source(player) needs to gather/send information to the server, in this case youre only playing an animation and storing a random outcome to an array, thats all locally ( clientside )
Quick question, client sided I already have it so after the “fishing” task is over , a random fish is spawned in front of the player with values such as name, price, hex number, model, etc… if I wanted to make this work client / server then I have to move the fish creation to the server, save it to the db (what user caught) then pass the name, price, hex, and model to the client so he can see what he caught right?
Why do you need to save it in a database? What are you tying to accomplish?
If you want to store what the user has caught (for whatever reason) then you don’t need to “create” the fish on server, you can just send the values to a server event to store in the database.
I guess it’s because I wanted to save having to check if the fish inventory is full or not before creating a fish, so I wanted to move the fish creation to the server and before it does anything check if the count is == 20 on the database first.