Mmmmm, use RaycastAll to get all the colliders. Why ? Because you'll hit the entity itself and that will be useless. For example, if you raycast from a wall position you'll probably hit the wall collider and so it will allways give true;
RaycastHit[] hits =...
Okey, I get what you want to do but looping on all Structures when a player is hit is a very very bad idea.
Any server can reach easily 50k structures and we don't have quantum computers. Imagine 3 players shooting at the same time each other. In less than a second looping through 150k objects...
That's what I've asked. World.Spawn() takes as first argument the prefab as a string.
If there's a prefab named Large Wood Storage then perfect but I haven't tried that.
Mmm I think that wouldn't work.
Server.Players is a list of the current players.
Fougerite.Player is a type.
With "is" you are checking if the type of the object is the type of whatever you want.
I used to do that but handling exceptions and this stuff is very bad.
Now, what I use is (in C#) :
if (HurtEvent.Attacker is Fougerite.Player)
{
// CODE HERE
}
This is way faster and easier to read.
Mmmm
ini = Plugin.GetIni("Settings")
keys = ini.EnumSection("Items")
for key in keys:
Util.Log(key + "=" + ini.GetSetting("Items", key))
Is that what you mean ?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.