ITEM.name = "Karabiner 98k"
ITEM.uniqueID = "k98k"
ITEM.class = "weapon_sim_kar98k"
ITEM.model = Model("models/weapons/b_k98_f.mdl")
ITEM.desc = "A bolt-action rifle with a wooden stock and a rather plain design."
ITEM.loweredOrigin = Vector(3, 0, -4)
ITEM.loweredAngles = Angle(0, 45, 0)
ITEM.attachmentBone = "ValveBiped.Bip01_Spine"
ITEM.attachmentOffsetAngles = Angle(0, 0, 0)
ITEM.attachmentOffsetVector = Vector(-2, 5, 4)
I have all this yet it's still not equippable, am I missing something?
Fixed charfallover/act bugs.
- Your animation will stuck when you use /charfallover while you're acting something.
( ex. using /charfallover while you're in /actsit. )
[QUOTE=pilot;41979543]I tried, I put the:
[CODE]if (CLIENT) then
ITEM:Hook("Use", function()
something()
end)
end[/CODE]
Right under the ITEM script. To be exact under:
[CODE]ITEM.functions.Use = {
}[/CODE]
No luck though.[/QUOTE]
Well since you did ITEM.functions.Use = {}, you cleared the Use function.
[QUOTE=Chessnut;41983849]Well since you did ITEM.functions.Use = {}, you cleared the Use function.[/QUOTE]
So, should I use something else in stead like toggle? Because if I just take out the:
[CODE]ITEM.functions.Use = {
}[/CODE]
It only lets me take and drop.
Remove the ITEM.functions.Use = {} from your item.
[editline]27th August 2013[/editline]
Misread, show me your item file
[QUOTE=Chessnut;41983897]Remove the ITEM.functions.Use = {} from your item.
[editline]27th August 2013[/editline]
Misread, show me your item file[/QUOTE]
Alright, so this is my setup:
[CODE]ITEM.name = "Citizen Terminal"
ITEM.uniqueID = "ter"
ITEM.model = Model("models/props_combine/combine_intmonitor001.mdl")
ITEM.desc = "This terminal appears to be ONLINE."
ITEM.functions = {
}
if (CLIENT) then
ITEM:Hook("Use", function()
terminalmenu()
end)
end[/CODE]
I have it saved as a plugin in the plugins folder in my schema. And I put the derma file the terminalmenu() in the nutscript gamemode in derma.
Get rid of ITEM.functions = {}
[QUOTE=Chessnut;41984000]Get rid of ITEM.functions = {}[/QUOTE]
No luck. Is it something in the files the way it's set up?
ITEM.functions is a table that contains all custom functions like Use, Drop, Take, etc.. And each entry like ITEM.function.Use contains a run function. If ITEM.function.Use is an empty table, then it has no run function and will not show up as an option. If ITEM.functions is empty then there are no functions to begin with.
[QUOTE=Chessnut;41984132]ITEM.functions is a table that contains all custom functions like Use, Drop, Take, etc.. And each entry like ITEM.function.Use contains a run function. If ITEM.function.Use is an empty table, then it has no run function and will not show up as an option. If ITEM.functions is empty then there are no functions to begin with.[/QUOTE]
So, would I be able to put:
[CODE]if (CLIENT) then
ITEM:Hook("Use", function()
terminalmenu()
end)
end[/CODE]
in ITEM.functions?
EDIT:
Wait, no. Gah, need to think about this.
[lua]
ITEM.functions = {}
ITEM.functions.Use = {
use = function()
if (CLIENT) then
something()
end
end
}
[/lua]
[QUOTE=Chessnut;41984209][lua]
ITEM.functions = {}
ITEM.functions.Use = {
use = function()
if (CLIENT) then
something()
end
end
}
[/lua][/QUOTE]
Thought it would work, but instead it just deletes the item altogether.
Is it okay that I have the something() put in the nutscript/gamemode/derma/cl_terminal
[editline]27th August 2013[/editline]
Alright, got this to work finally!
I just did:
[CODE] run = function(data)
if (CLIENT) then
terminalmenu()
end
if (SERVER) then
return
end
end[/CODE]
But, now...I'm trying to get the item to not be taken and for it to only work if the player has the cid intem in his inventory.
are you going to make the creation menu better? some things don't make a lot of sense for people that have more than 10 player models like the "spinning player while we click the arrows to change the model so I can't see the face half the time". It'd be better if you just did a menu with spawnicons for selecting it, IMO
You're looking at the old video, here's the new one:
[media]http://www.youtube.com/watch?v=eDR6Ozpt0vw[/media]
Is the Nutscript Wiki ever going to be filled up 100%? And if so, are you anticipating it to happen after a long time?
[QUOTE=Chessnut;41988135]You're looking at the old video, here's the new one:
[/QUOTE]
Well thats it in a [B]nut[/B]-shell...I crack myself up.
On a more serious note, could someone show an example item for a medical use item and for a clothing item.
Thanks.
And a full example of a weapon item since everyone that explained it beforehand hasn't helped a bit.
[QUOTE=a-cookie;41967942][lua]ITEM.base = "base_wep"
ITEM.name = "Electrified Baton"
ITEM.uniqueID = "stickstun"
ITEM.class = "weapon_stunstick"
ITEM.model = Model("models/weapons/w_stunbaton.mdl")
ITEM.desc = "A small metal rod held together with duct tape, the end glows deep."[/lua]
easy peasy[/QUOTE]
are you seriously not able to get this
Made a tutorial on YouTube of how to install NutScript.
[url]http://www.youtube.com/watch?feature=player_embedded&v=xVquitzkoVQ[/url]
Is there a way for me to show the description of a player in derma without having to do something crazy?
Like
[CODE]
local desctext12 = vgui.Create( "DLabel", undertext )
desctext2:SetPos( ScrW() * 0.01, ScrH() * 0.1 )
desctext2:SetText( description)
desctext2:SetTextColor(Color( 0, 100, 150, 255 ))
desctext2:SizeToContents()
[/CODE]
[media]http://www.youtube.com/watch?v=_WiJDyLSmdM[/media]
Working on WEPON BASE.
[QUOTE=a-cookie;41995156]are you seriously not able to get this[/QUOTE]
when i edited that code the weapon became unequippable kipper
it was also listed under the miscellaneous category
clearly its something you did wrong here and not me
[QUOTE=rebel1324;41999752][media]http://www.youtube.com/watch?v=_WiJDyLSmdM[/media]
Working on WEPON BASE.[/QUOTE]
Those are some loud gunshots. I like it. Add some form of ear protection item.
Is there a list where I can get all the data. stuff like:
data.charname
data.faction
[lua]
charData.charname -- Character's name.
charData.description -- Their description.
charData.gender -- Their gender, either "male" or "female"
charData.money -- Money as a number.
charData.inv -- Table of inventory.
charData.chardata -- Table of additional character data.
charData.faction -- Number for team index. (FACTION_BLAH = 1, 1 would be the value)
charData.model -- Their model.
[/lua]
[QUOTE=Chessnut;42001967][lua]
charData.charname -- Character's name.
charData.description -- Their description.
charData.gender -- Their gender, either "male" or "female"
charData.money -- Money as a number.
charData.inv -- Table of inventory.
charData.chardata -- Table of additional character data.
charData.faction -- Number for team index. (FACTION_BLAH = 1, 1 would be the value)
charData.model -- Their model.
[/lua][/QUOTE]
Alright, thanks so much! As an exmaple for this would I be to do something like:
[CODE]
function SCHEMA:GetDefaultInv(inventory, client, data)
if (charData.inv, "flashlight") then
inventory:Add("brick")
end
end
[/CODE]
As a way of saying like...If the player has a flashlight give them a brick.
Since the data.inv is a string, you could try string.find(data.inv, "flashlight")
[QUOTE=Chessnut;42002219]Since the data.inv is a string, you could try string.find(data.inv, "flashlight")[/QUOTE]
Hm, so I tried this concept on a similar thing:
[CODE]
if (CLIENT) then
function SCHEMA:GetDefaultInv(inventory, client, data)
if (string.find(data.inv, "Citizen ID")) then
something()
end
end
end
[/CODE]
And I put it in an item file. Could it be because :GetDefaultInv is a serverside thing? And if that is the case, something() is a derma command which means it would need to be put into the client part. Anything seems off? Or could be fixed?
[QUOTE=hooghoog;42000045]when i edited that code the weapon became unequippable kipper
it was also listed under the miscellaneous category
clearly its something you did wrong here and not me[/QUOTE]
uh blatantly
show your item code
are you saying you did that on purpose
anyways
ITEM.name = "Karabiner 98k"
ITEM.uniqueID = "k98k"
ITEM.class = "weapon_sim_kar98k"
ITEM.model = Model("models/weapons/b_k98_f.mdl")
ITEM.desc = "A bolt-action rifle with a wooden stock and a rather plain design."
ITEM.loweredOrigin = Vector(3, 0, -4)
ITEM.loweredAngles = Angle(0, 45, 0)
ITEM.attachmentBone = "ValveBiped.Bip01_Spine"
ITEM.attachmentOffsetAngles = Angle(0, 0, 0)
ITEM.attachmentOffsetVector = Vector(-2, 5, 4)
Sorry, you need to Log In to post a reply to this thread.