Jump to content

Trigger a table from client-side....


WiBox

Recommended Posts

I'm trying to trigger a event in it I want to trigger a table to the client side..

skinsShaders = {
    { skinTo = "RIP", texture = "jpg2/278", worldname = "Sbmotr2", skinID = 134 },
    { skinTo = "RIP", texture = "jpg2/298", worldname = "swmotr5", skinID = 230 },
}

function sendDatas()
    triggerClientEvent("applyTheShaderOnSkin", resourceRoot, skinsShaders)
end
setTimer(sendData, 5000, 1)

The thing is, at the Client side I want to get the "skinTo", "texture", "worldname" and "skinID"...

Server Side:

-- Example, ofc not working...
addEvent("applyTheShaderOnSkin", true)
function applyTheShaderOnSkin ( table)
    for index, value in pairs ( table ) do
        if ( index == 1 ) then
            element = value.skinTo
        elseif ( index == 2 ) then
            textureName = value.worldname
        elseif ( index == 3 ) then
            texturePath = value.texture
        end
        --.........
    end
end
addEventHandler("applyTheShaderOnSkin", root, applyTheShaderOnSkin)

I need it like in this form.... is there anyway I can make that? If it's not possible, I'll appreciate if he say it.

Link to comment
  • Moderators
skinsShaders = {
    { skinTo = "RIP", texture = "jpg2/278", worldname = "Sbmotr2", skinID = 134 },
    { skinTo = "RIP", texture = "jpg2/298", worldname = "swmotr5", skinID = 230 },
}

function sendDatas()
    triggerClientEvent("applyTheShaderOnSkin", root, skinsShaders)
end
setTimer(sendData, 5000, 1)

 

addEvent("applyTheShaderOnSkin", true)
function applyTheShaderOnSkin(table)
    for _, value in ipairs(table) do
        local skinTo = value.skinTo
		local textureName = value.worldname
		local texturePath = value.texture
		
		-- use variables
    end
end
addEventHandler("applyTheShaderOnSkin", root, applyTheShaderOnSkin)
Edited by Patrick2562
Link to comment

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