Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 10 11 12 13 14 … 18 Next »
SF Entity:getEnvironmentData()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
SF Entity:getEnvironmentData()
31-01-2016, 03:47 PM,
#1
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
SF Entity:getEnvironmentData()
Well i am working on an anti-intruder system which jails all players when i am in space. I am using Entity:getEnvironmentData() for this. Basicly i am doing this:

local Players = find.allPlayers()
for i = 1 ,#Players do
local Env = Players[i]:getEnvironmentData().Entity
if IsValid( Env ) and Env == LSCores[1] then
print("Someone entered our ship")
end
end

If I correctly understood how this function works it should only print the message if I am in space and my LS Core is on. But for some reason it also prints it when i am on a planet with turned on LS Core. But only if someone is beaming in or out of my ship with the Star Trek teleporter. And their enviroment stays as my LS Core only during the transporting process. After that it goes back to the planet enviroment.
Is this a bug in my code or in Entity:getEnvironmentData()?
If it is a bug in my code how do i resolve this?

SuperPlayer
Find
Reply
31-01-2016, 03:58 PM,
#2
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: SF Entity:getEnvironmentData()
I've had it as well, also pretty sure jailing players was forbidden in some discussion because of troubling events with LocInt's base.
People now just beam the intruder to spawn.

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
31-01-2016, 04:01 PM,
#3
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: SF Entity:getEnvironmentData()
Well i am jailing them for 5 seconds and telling them to not come back without my permission and then i am beaming them away.
Find
Reply
31-01-2016, 04:38 PM,
#4
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
RE: SF Entity:getEnvironmentData()
Had the same problem with that function when I tried to send a Welcome message to players that enter my ship. For me it never worked well. It just displayed sometimes when someone beamed in, as you said. It didn't worked in space at all.

That seems a bit buggy, or is it just me?

[Image: ldkcVkq.jpg]
Find
Reply
31-01-2016, 07:53 PM,
#5
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: SF Entity:getEnvironmentData()
It assigns the LS core because players that are transporting are not solid, and don't trigger the planet's environment until they finish materialising (and are thus solid again). This will be fixed after the next server restart(s).
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.