Help-Wiremod + lua

Is there any way to send a wire value to a value in lua script? Say I have a wired button, that when pressed, sends out 1. In a lua script, if the value equals one, it performs a function. But how would I retrieve the value?

Also, how do I edit player respawn points?

You can make your entity have wire inputs by using the following code in ENT:Initialize
[lua]
self.Inputs = Wire_CreateInputs(self.Entity, {“NameOfFirstInput”, “NameOfSecondInput”, “NameOfThirdInput”})
[/lua]
You can have any number of inputs, this is just an example with three.

Then you need an ENT:TriggerInput function:
[lua]
function ENT:TriggerInput(name, value)
if name == “NameOfFirstInput” then
– do stuff with value
elseif name == “NameOfSecondInput” then
– do stuff with value
elseif name == “NameOfThirdInput” then
– do stuff with value
end
end
[/lua]

Note that Wiremod will only call that function when the input changes. If you need to access the input more often than that you can use something like:
[lua]
– in ENT:Initialize
self.FirstInput = 0

– in ENT:TriggerInput
if name == “NameOfFirstInput” then
self.FirstInput = value
end

– somewhere else
Msg("The value of the input is " … tostring(self.FirstInput) … "
")
[/lua]

Thanks, this really helps, but how do I specify a specific entity?

What do you mean, a specific entity?

nvm i figured out what i need to do