997
edits
(Created page with "{{Object |image1 = LifeSensor.png |type = {{#invoke:GetPartInfo|getField|Type}} |uses = <!-- --> |recipe = {{#invoke:GetPartInfo|getField|Recipe}} |raw_recipe = {{#invoke:GetPartInfo|getField|Raw recipe}} |malleability = {{#invoke:GetPartInfo|getField|Malleability}} |durability = {{#invoke:GetPartInfo|getField|Durability}} |configuration = {{#invoke:GetPartInfo|getField|Configuration}} }} <!-- Some information --> The LifeSensor is a...") |
mNo edit summary |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1:
{{Object
|title1 = {{PAGENAME}}
|durability={{#invoke:GetPartInfo|getField|Durability}}
|default_colour={{#invoke:GetPartInfo|getField|DefaultColor}}
|flammable={{#invoke:GetPartInfo|getField|Flammable}}
}}
<!-- Some information -->
The LifeSensor is a part used in programming. It detects life within 2000 studs. Lifesensors are found in all aliens as a way to sense players. In order to use, you must use the LifeSensor:GetReading() function. It will return a dictionary of all the nearby players and their locations, given in Vector3. It can also return [[Stan]] as a player.<b>
===the script below is an example of a turret that uses a lifesensor.===
<syntaxhighlight lang="lua" line="1">
local LifeSensor = GetPartFromPort(1, "LifeSensor") --gets the lifesensor instance
local gyro = GetPartFromPort(2, "Gyro") --gets the gyro instance
local whitelist = {
["YourUsername"] = true; -- Create a whitelist of who it wont target
["YourFriend"] = true;
}
local reading = LifeSensor:GetReading() -- gets the reading of the lifesensor
for player, location in pairs(reading) do
if not whitelist[player] then --checks if player isnt whitelisted
gyro:PointAt(location) -- points the gyro at the location
end
end
</syntaxhighlight>
<!-- Automated fields -->
Line 23 ⟶ 42:
[[Category:Parts]]
==Gallery==
[[File:RobloxScreenShot20230720 163444335.png|thumb|left|Players, including Stan appearing on Player Radar which uses a lifesensor]]
|