Jump to content

Knowledge book problem


Recommended Posts

well, its working when server starts first but after joining again it just crashes. help please :(

here is the script:

 

ocal function changetree(inst)	local sci, mag, anc		if GetPlayer():HasTag("book3get") then sci = 1 else sci = 0 end	if GetPlayer():HasTag("book2get") then mag = 2 else mag = 0 end	if GetPlayer():HasTag("book1get") then anc = 2 else anc = 0 end		if GetPlayer().components.journalknow then        GetPlayer().components.journalknow:SetKnow(sci, mag, anc)    end		return inst	endlocal function OnDropped(inst)	if GetPlayer():HasTag("book3get") then GetPlayer():RemoveTag("book3get") end	if GetPlayer():HasTag("book3store") then GetPlayer():RemoveTag("book3store") end	changetree(inst)	return instendlocal function OnPickup(inst)	if inst.components.inventoryitem:GetSlotNum() then		if GetPlayer():HasTag("book3get") then GetPlayer():RemoveTag("book3get") end		if not GetPlayer():HasTag("book3store") then GetPlayer():AddTag("book3store") end	else		if not GetPlayer():HasTag("book3get") then GetPlayer():AddTag("book3get") end		if GetPlayer():HasTag("book3store") then GetPlayer():RemoveTag("book3store") end	end	changetree(inst)	return instend

thanks :))

Link to comment
Share on other sites

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
 Share

×
  • Create New...