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

How do I use the Duration property in a spawn location?

I want a game where you have a inf force field but when you are in the game, it goes away. Script:

script.Parent.Touched:Connect(function()
	game.Workspace.Spawn_Area.SpawnLocation.Duration = 0
end)

Nothing happens. Please help me. Thank you!

My script that puts you in game:

local seconds = game.Workspace.Time
local ingame = game.Workspace.InGame.Value
local Game = game.Workspace.Game.Position


while true do

	wait(1)
	seconds.Value = seconds.Value - 1

	if seconds.Value == 0 and ingame == 0 then

		ingame = 1
		seconds.Value = 30

		local teleport = game.Players:GetChildren()
		for i = 1, #teleport do
			teleport[i].Character:MoveTo(Vector3.new(Game.X, Game.Y, Game.Z))

		end
	end

	if seconds.Value == 0 and ingame == 1 then

		ingame = 0
		seconds.Value = 15

		local teleport = game.Players:GetChildren()
		for i = 1, #teleport do
			teleport[i]:LoadCharacter()

		end
	end


end

1 answer

✓ Accepted answer

Put this inside ServerScriptService inside a script.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local ff = Instance.new("ForceField")
		ff.Parent = character
	end)
end)

1 comment

0

It is inf, but does not go away when you are ingame. This might help you understand: (I will edit it)

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