EW1611

Ajuda com elementos

Recommended Posts

olá, queria colocar a mochila de dinheiro(id: 1550), no player, ja tentei com o bone_attach, não consegui, e tentei com o attachElement mas diz que não posso criar mais elementos. esse é o ultimo script q tentei(o mais simples possivel)


function bag(player)
	bag1 = createElement("object", 1550)
	attachElements(bag1, player)
end
addCommandHandler("bag", bag)

Obrigado.

Share this post


Link to post

fiz assim

local x, y, z = getElementPosition(player)

function bag(player)
	bag1 = createObject(1550, x, y, z)
	attachElements(bag1, player)
end
addCommandHandler("bag", bag)

erros na linha 1(Bad argument @ 'getElementPosition' [expected element at agument 1, got nil]); linha 4 (bad argument @ 'createObject' [Expected vector 3 at argument 2, got boolean]); linha 5 (Bad argument @ 'attachElements' [expected element at argument 1, got boolean]).

Share this post


Link to post

Tente isso:

function bag(player)
	local x, y, z = getElementPosition(player)  
	bag1 = createObject(1550, x, y, z)
	attachElements(bag1, player)
end
addCommandHandler("bag", bag)

EDIT: Não testei!

Share this post


Link to post

Esse código deve ser server-side. Provavelmente você deixou no lado client.

Share this post


Link to post

Então não sei o que é. Testei aqui e funcionou.

Share this post


Link to post
Posted (edited)

Na verdade foi agr, erro bobo no XML, desculpe o incomodo

Edited by EW1611

Share this post


Link to post

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.