How can i make a personality core SENT explode on attack?
14 replies, posted
abandoned
In [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/OnTakeDamage]ENT:OnTakeDamage[/url] explode and remove the entity.
[QUOTE=code_gs;52255028]In [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/OnTakeDamage]ENT:OnTakeDamage[/url] explode and remove the entity.[/QUOTE]
That didn't help much. Mostly because im a noob at lua, heck coding in general.
[editline]20th May 2017[/editline]
Can somebody else reply. I Really don't want to upload another un-special core.
Here's the other functions you need:
[url]https://wiki.garrysmod.com/page/util/Effect[/url]
[url]https://wiki.garrysmod.com/page/Entity/Remove[/url]
Attempt to do the task you wish and we can help you tweak it and fix any errors.
Is it supposed to be this? [CODE]function ENT:OnTakeDamage( CTakeDamageInfo damage )
util.Effect( string effectName, CEffectData effectData, boolean allowOverride=true, any ignorePredictionOrRecipientFilter=nil )
Entity:Remove()[/CODE]
AGAIN. I Do not know anything about lua.
Please somebody help me. I Know it sounds beggish but i need this feature.
You can try it better dude...come on
[highlight](User was banned for this post ("Post a helpful reply or don't post at all" - Kiwi))[/highlight]
[QUOTE=gonzalolog;52256467]You can try it better dude...come on[/QUOTE]
I Don't know HOW
A few things: the wiki just defines the datatype and what the variable is. You have to put the actual data into the function. Read the util.Effect effect list and examples.
In ENT functions, the entity is defined as "self" since you're defining it as a meta method, so you'd run self:Remove ().
Lastly, you need an end to close the function.
[QUOTE=code_gs;52256647]A few things: the wiki just defines the datatype and what the variable is. You have to put the actual data into the function. Read the util.Effect effect list and examples.
What do i need to put in the SLOTS.
And do i need to put any enters in?
I May look like i'm getting on the right track. But really i'm completely stranded your throwing me in with some parts but no glue to put em' together
What are slots and enters?
T_T Did you even read the pages.
HERES A QUOTE! " string effectName
The name of the effect to create.
CEffectData effectData
The effect data describing the effect.
boolean allowOverride=true
Whether Lua-defined effects should override engine-defined effects with the same name for this/single function call.
any ignorePredictionOrRecipientFilter=nil
Can either be a boolean to ignore the prediction filter or a CRecipientFilter.
Set this to true if you wish to call this function in multiplayer from server"
And enters as in any Z axis spaces between the LUA lines.
Those are called arguments, and Lua doesn't care about newlines or whitespace between lines. I would recommend reading at least a very basic Lua tutorial so you know how to properly format your code: [url]https://www.lua.org/pil/1.html[/url]
[QUOTE=code_gs;52256857]Those are called arguments, and Lua doesn't care about newlines or whitespace between lines. I would recommend reading at least a very basic Lua tutorial so you know how to properly format your code: [url]https://www.lua.org/pil/1.html[/url][/QUOTE]
Sorry i don't have the time to study this.
I Just need to know what script i need. And if it keeps going like this i won't have the f*cking explosion in the addon.
[QUOTE=milkiwill;52256874]Sorry i don't have the time to study this.[/QUOTE]
Oh ok then, I have the perfect solution for you! Go to [url]https://www.gmodstore.com/[/url] and stop wasting our time.
This forum is meant to help developers achieve their goal and make the script they want to, not to spoonfeed people asking for help.
You're also being incredibly rude considering [I]you[/I] are the one that wants something done for them.
If you happen to change your mind, and decide you actually want to learn, here's a good start:
[url]https://facepunch.com/showthread.php?t=1337945[/url]
[url]https://facepunch.com/showthread.php?t=1557600[/url]
Sorry, you need to Log In to post a reply to this thread.