You can if you want. However since you're not you need to use traces to see if the player(s) is visible.
-snip- Read below.
I just have a simple question, does a Nexbot coroutine work for any "instant coroutine" actions (such as ENT:Think or ENT:BehaveUpdate)?
I want to make it so that the NPC can instantly react to enemies instead of relying on coroutine.wait (yes I know I can set that to 0.1, but that screws up the other actions like wandering), but using either of the above functions gives me an "attempt to yield across C-call boundary" error.
Custom TTT playermodel
How can I make it so that Terrorist (Traitors and Terrorist) have certain playermodel as a default. While not overriding the Pointshop playermodels if they do have one equipped.
Also is this right for detectives default playermodel? It doesnt seem to work. For the model.mdl do I put the directory too?
hook.Add("TTTBeginRound", "BeginRoundDetectiveSkin", function()
for k,v in pairs(player.GetAll()) do
if v:IsActiveDetective() then v:SetModel(Model("your_model.mdl")) end
end
end)
Hey guys, I'm trying to loop a animation sequence, I searched everywhere but can't figure it out.
[CODE]
local function LoopAnimation( panel, model )
if ( !panel or !IsValid( panel.Entity ) ) then return end
local animz = GetConVar("test_anim")
local Sequez = panel.Entity:LookupSequence( animz:GetString() )
if ( Sequez ) then
timer.Adjust( "lol", panel.Entity:SequenceDuration( Sequez ), 0, function()
panel.Entity:ResetSequence( Sequez )
end)
end
end
[/CODE]
This is the code that I made so far, but it still plays the animation and stops if it's not looped by default.
Any tips to make this work ?
Thanks !
Just a quick question, is "dat" a whitelisted extension for resource.AddFile?
Anyone who knows how to use special characters such as Æ, Ø and Å which i need to my changelog i made in my spawn.
[QUOTE=James xX;48254086]Just a quick question, is "dat" a whitelisted extension for resource.AddFile?[/QUOTE]
There's only a blacklist. ".dat" isn't blacklisted.
Last time I checked: [code].cfg
.lst
.exe
.vbs
.com
.bat
.dll
.ini
.log
.lua
.db
.vdf
.smx
.gcf
.sys[/code]
Hello guys,
I'm currently having a problem, where the player gets out of a vehicle after changing a job in darkrp 2.6.
Any idea what could cause it?
(The car is still there and I can jump in again)
[QUOTE=Dunkstormen;48255569]Anyone who knows how to use special characters such as Æ, Ø and Å which i need to my changelog i made in my spawn.[/QUOTE]
How are you displaying it?
[editline]21st July 2015[/editline]
[QUOTE=P4sca1;48255735]Hello guys,
I'm currently having a problem, where the player gets out of a vehicle after changing a job in darkrp 2.6.
Any idea what could cause it?
(The car is still there and I can jump in again)[/QUOTE]
It's done here:
[url]https://github.com/FPtje/DarkRP/blob/6135426c601763462f560f97f52f6371170008b0/gamemode/modules/jobs/sv_jobs.lua#L130[/url]
It's done here:
[url]https://github.com/FPtje/DarkRP/blob/6135426c601763462f560f97f52f6371170008b0/gamemode/modules/jobs/sv_jobs.lua#L130[/url][/QUOTE]
Thanks! Since DarkRP is always saying "Do not edit core files!" etc I'm wondering whether I can just comment this?
[QUOTE=P4sca1;48255783]It's done here:
[url]https://github.com/FPtje/DarkRP/blob/6135426c601763462f560f97f52f6371170008b0/gamemode/modules/jobs/sv_jobs.lua#L130[/url][/QUOTE]
Thanks! Since DarkRP is always saying "Do not edit core files!" etc I'm wondering whether I can just comment this?[/QUOTE]
Make sure the player is still getting their job weapons on team change. There's probably a reason to do this?
And why exactly is DarkRP doing this?`Would it be a problem when I comment it?
[editline]20th July 2015[/editline]
Ah, I'll just try it out ^^
[editline]20th July 2015[/editline]
seems to work fine.
[editline]21st July 2015[/editline]
Because I can't find this with google: Is there an addon for a breakdown truck which can hook other cars when they are broken (using vcmod ) and can drive them to any place?
Is there any functions that makes only specific players be ignored by NPCs?
I'm trying to make a cloaking system and while the visuals are easy (since I'm doing those in PAC3), actually getting NPCs to not see me is the hard part. I have no idea where to start.
[QUOTE=SuperDuperScoot;48256200]Is there any functions that makes only specific players be ignored by NPCs?
I'm trying to make a cloaking system and while the visuals are easy (since I'm doing those in PAC3), actually getting NPCs to not see me is the hard part. I have no idea where to start.[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetNoTarget]Player:SetNoTarget[/url]
[QUOTE=man with hat;48256231][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/SetNoTarget]Player:SetNoTarget[/url][/QUOTE]
Hmm.. Seems to be buggy and inconsistent with scripted NPCs, but I can work with this. Thanks.
Whenever I spawn an object as an entity, it doesn't have it's multiple skins or animations. If I spawn the model itself from the spawn menu then it does. Is there something needed in the Lua to effectively "load in" its resources?
[code]Aborting HTTP request because pResponse->BSetBodyData() failed.[/code]
[del]and now i'm haunted by this bullshit again, for no reason :suicide:
is there a common fix? just using http.post here[/del]
the fuck, i changed the address and changed it back and now it works
how
I already made a thread for this problem but noone is really helping so I figured I'd just ask it here. I don't want to make this post extra lengthy by posting a video here so I'll link the video: [URL]https://youtu.be/XH6QIdAeARE[/URL] So, I want to achieve a recoil system as seen at 4:02 in the video. You'll notice that the player's view is pushed up then pushed slowly back down(I don't want to use ViewPunch for this). Could I achieve this by using math.Clamp, CurTime(), and self.Owner:EyeAngles()? Thanks. Link to the original thread:
Edit: Bump guys, I really need help >_<
[URL="http://facepunch.com/showthread.php?t=1477089&p=48262458#post48262458"]http://facepunch.com/showthread.php?t=1477089&p=48262458#post48262458
[/URL]
[editline]21st July 2015[/editline]
[QUOTE=nicolasx21;48253528]Hey guys, I'm trying to loop a animation sequence, I searched everywhere but can't figure it out.
[CODE]
local function LoopAnimation( panel, model )
if ( !panel or !IsValid( panel.Entity ) ) then return end
local animz = GetConVar("test_anim")
local Sequez = panel.Entity:LookupSequence( animz:GetString() )
if ( Sequez ) then
timer.Adjust( "lol", panel.Entity:SequenceDuration( Sequez ), 0, function()
panel.Entity:ResetSequence( Sequez )
end)
end
end
[/CODE]
This is the code that I made so far, but it still plays the animation and stops if it's not looped by default.
Any tips to make this work ?
Thanks ![/QUOTE]
For a DModelPanel just use RunAnimation. It automatically repeats the animation when it's done.
I'm having issues spawning a nextbot on the server starting.
I'm currently calling inside InitPostEntity with this
[lua]
local ent = ents.Create( "dealernpc" )
ent:SetPos( Vector(-358.065460, 190.269104, -139.968750) )
ent:SetAngles(Angle(0, 128, 0))
ent:DropToFloor()
ent:Spawn()
[/lua]
Nothing seems to spawn, however if I run that code in a concommand and manually execute it, it spawns the nextbot just fine?
[QUOTE=Mrkrabz;48268442]I'm having issues spawning a nextbot on the server starting.
I'm currently calling inside InitPostEntity with this
[lua]
local ent = ents.Create( "dealernpc" )
ent:SetPos( Vector(-358.065460, 190.269104, -139.968750) )
ent:SetAngles(Angle(0, 128, 0))
ent:DropToFloor()
ent:Spawn()
[/lua]
Nothing seems to spawn, however if I run that code in a concommand and manually execute it, it spawns the nextbot just fine?[/QUOTE]
I would run it in a timer in InitPostEntity. I remember having this problem aswell and being told that its either a known bug or a feature.
[QUOTE=James xX;48268468]I would run it in a timer in InitPostEntity. I remember having this problem aswell and being told that its either a known bug or a feature.[/QUOTE]
Had tried it inside a 10 second timer with still no avail, I can see the code is being ran, but nothing.
[QUOTE=MegaTronJohn;48262970]
For a DModelPanel just use RunAnimation. It automatically repeats the animation when it's done.[/QUOTE]
I'll try RunAnimation, thanks man !
Hey - my DTextEntry isn't working. It's showed up as grayed out. Here's a sceenshot:
[url]http://steamcommunity.com/sharedfiles/filedetails/?id=486297000[/url]
My DTextEntry code:
[CODE]local NameDTRe = vgui.Create( "DTextEntry", RetailNameFrame )
NameDTRe:SetPos( 10, 75 )
NameDTRe:SetSize( 480, 80 )
NameDTRe:RequestFocus()
NameDTRe:SetText( "Business Name Here" )
NameDTRe.OnEnter = function( self )
// do stuff
end[/CODE]
And when I parent it to the panel instead of the frame, it can be highlighted, looks normal, but can't be edited.
[QUOTE=Pazda;48269206]Hey - my DTextEntry isn't working. It's showed up as grayed out. Here's a sceenshot:
[url]http://steamcommunity.com/sharedfiles/filedetails/?id=486297000[/url]
My DTextEntry code:
[CODE]local NameDTRe = vgui.Create( "DTextEntry", RetailNameFrame )
NameDTRe:SetPos( 10, 75 )
NameDTRe:SetSize( 480, 80 )
NameDTRe:RequestFocus()
NameDTRe:SetText( "Business Name Here" )
NameDTRe.OnEnter = function( self )
// do stuff
end[/CODE]
And when I parent it to the panel instead of the frame, it can be highlighted, looks normal, but can't be edited.[/QUOTE]
Make sure it's parented to an EditablePanel
What do you mean by that? [url]http://wiki.garrysmod.com/page/Category:EditablePanel[/url] isn't very helpful
"[I]Base panel used by DFrame, this panel is needed so that elements such as the TextEntry can obtain focus.[/I]"
Make sure the DTextEntry is parented to a panel based off of the EditedPanel, or an EditablePanel itself. Make your DPanel an EditablePanel, and just paint that. The TextEntry has to be ontop of an EditablePanel in other words. (If I'm understanding your problem correctly, which I feel like I'm not, so apologies if that's the case)
Got it. Didn't understand really what EditablePanel meant and that cleared it up. Thanks so much!
Updating some code to support Gmod 13+ Here is the error and the line.
[CODE][Pweld] lua/autorun/pw_positioning.lua:31: function arguments expected near ':'
1. unknown - lua/autorun/pw_positioning.lua:0[/CODE]
[CODE]ent:Angle:Set(ent:GetNetworkedVector("Rotation"))[/CODE]
Sorry, you need to Log In to post a reply to this thread.