Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Best way to check player positions for changing health?

Asked by
trecept 367 Moderation Voter
5 years ago

I have a game with a safe zone and a zone where players can battle. I want to make it so players have infinite health in the safe zone and back to normal health in the battle zone. But I have had so many problems and I just can't seem to figure out how to do this.

I don't want to use a Touched event on an invisible brick as this is too easily exploitable. I tried using Region3s, but I keep getting an error and I've asked twice here and no one seems to know how to help me, basically one region3 is working and the other doesnt work ever.

The only other solution I know of is raycasting and I don't think that's the right thing to use for checking positions. Any assistance please?

1
If it's a basic box zone, wouldn't it be possible to just check that each coordinate of the character's torso is within the box? Connect a change event to a character's humanoid on spawn which sets their health to full if their torso is within certain coordinates? fredfishy 833 — 5y
0
Why don't detect player touches an object? Leamir 3138 — 5y
0
Checking coordinates and seeing whether a player is within them or not always confused me (I only know how to semi do this with regions) trecept 367 — 5y
1
`if ((torso.x > 100 and torso.x < 200) and (torso.y > 100 and torso.y < 200) and (torso.z > 100 and torso.z < 200)) then` would check that the player's torso is within a 100x100x100 box with origin (100, 100, 100). fredfishy 833 — 5y
View all comments (2 more)
0
also store your real health within a diffrent value then change it to infinity and then when they leave change it to your stored value ThisIsAnAccount255 143 — 5y
0
Thank you! trecept 367 — 5y

Answer this question