Hi, I am now spent some coding of an entity and in the console there to error:
[QUOTE][ERROR] addons/ulib/lua/ulib/shared/sh_ucl.lua:42: attempt to index a string value with bad key ('IsValid' is not part of the string library)[/QUOTE]
There is the code:
[QUOTE]AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:SetModel("models/props_debris/concrete_chunk04a.mdl") -- Model que tu peux changé
self:SetColor(Color(255,255,255,255))
self:SetMaterial("models/debug/debugwhite")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()
end
function ENT:Use( player, cmd, args )
if ULib.ucl.query( "switchentities" ) then
player:changeTeam( TEAM_POLICE ) -- Team que tu peux changé
self:Remove()
else
ply:PrintMessage( HUD_PRINTTALK, "Vous ne possedez pas la permission ! ")
end
end[/QUOTE]
and the second part of the code that is in lua> autorun> server :
[QUOTE]if SERVER then ULib.ucl.registerAccess( "switchentities" , ULib.ACCESS_SUPERADMIN, "Autorise a interagir avec entite", "switch" ) end[/QUOTE]
this is the first time I use ulx or ulib in an addon.
sorry for my English because I'm not English .
Thats not the code with IsValid, and try [lua] tags
I don't understand .
1. Post the full error instead of just the first line.
2. Use [lua] tags on the forum instead of [quote] tags
3. You are probably using ULib wrong
[editline]3rd November 2016[/editline]
[url]http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.query[/url]
Sorry, you need to Log In to post a reply to this thread.