Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[PLEASE HELP] How should I create Player Invincible in SPAWN? {READ MORE}

Hi I'm dumb at scripting on ROBLOX :P Please answer my question down below. :P :) :D So my question is "How do I create CODE that will apply player ForceField when he is in Spawn area, but when he left the area, teleports somewhere else in the world he lost forcefield? " Please Answer me in possibly shorter time! Specially Thanks, everyone who helps!

1 answer

✓ Accepted answer
while true do
	for i,v in pairs(game.Workspace:GetChildren()) do
		if v.ClassName == "SpawnLocation" then
			if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - v.Position).magnitude >= 20 then -- make twenty the distance you want
				game.Players.LocalPlayer.Charcter --Locate the humanoid and then put :Destroy()
			else
				--Do the opposite for when you get in range of the spawn
			end
		end
	end
wait()
end

2 comments

0

Look my friend, so that will work in StudioMode because of LocalPlayer...

0

It is a LocalScript...So it will go in a local parent such as StarterGui or StarterPack. I made it comparable with FE.

This discussion is preserved as it was. New answers, comments, and votes are closed.