M_kane3

Roblox scripter · Luau

Hey! I mostly script the server side of games: saving player data, stopping exploiters, NPCs, and the math behind combat stuff. Here are some of my scripts with notes on how they work. Feel free to look through them.

Scripts · Contact

Scripts

PlayerDataService

ModuleScript · ServerScriptService

Saves player data with a session lock, so two servers can never write the same profile at once (that's how a lot of item dupes happen). It uses UpdateAsync instead of SetAsync, retries with backoff when DataStores throttle, and upgrades old save formats one version at a time.

SecureRemote

ModuleScript · ServerScriptService

Every RemoteEvent on the server goes through this. It rate-limits each player with a token bucket (5 per second, bursts of 10) and checks every argument's type. It also rejects NaN and infinity, which a lot of games forget about.

GuardAI

ModuleScript · ServerScriptService

A state machine for a guard NPC: Patrol, Chase, Attack. It spots players with a vision cone (dot product) and a raycast so it can't see through walls. It only recomputes its path when the target has moved more than 6 studs, because ComputeAsync is slow.

TerrainGenerator

Script · ServerScriptService

Makes a 256×256 stud island from a few layers of noise, then picks sand, grass, rock or snow for each column from its height and how steep it is. Water only replaces air, so it doesn't wipe the land underneath.

Preview, seed 4217(JS version of the noise, so it won't match math.noise exactly)

Ballistics

ModuleScript · ReplicatedStorage

Works out what angle to fire at to hit a target at a set speed. There are usually two answers, a low arc and a high one. It can also lead moving targets, and it draws the exact arc with one Beam, since a parabola fits a Beam's curve perfectly.

Click or drag to move the target. Gravity is 196.2 studs/s², same as Roblox.

Spring

ModuleScript · ReplicatedStorage

A damped spring for camera sway, viewmodels and UI. It's solved exactly instead of stepped every frame, so it moves the same at any FPS and can't blow up on a lag spike. Works with numbers and Vector3s.

Contact

Message me if you need a scripter.