|
Hi, I'm new to scripting and would like to know how to remove all the players forcefields with a script. Thanks :) |
|
RipullJoin Date: 2008-07-21 Post Count: 14249 |
Click on a spawn, and edit the forcefield time length. |
|
|
Oops, forgot to specify, I'm making a game where it teleports you to a place and I want it to remove all forcefields from players when they get teleported there. Sorry for not specifying. |
|
RipullJoin Date: 2008-07-21 Post Count: 14249 |
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if( character:FindFirstChild("ForceField") )then
character.ForceField:Destroy();
end;
end);
end); |
|
|
|
Wait, I need a line of script that removes all forcefields when the script goes to a specific line and not on player added. Sorry for the misunderstanding |
|
|
"I need help with a script."
you never posted a script this forum is for helping people with existing scripts. |
|
|
Oh oops, another mistake. I'm so sorry for all the misunderstandings >.< |
|
|
awh now I feel bad shtap dat :c |
|
|
No no no, don't feel bad. It's my fault for not specifying exactly lol, Thanks anyways XD |
|
|
|
|
Ahh ok, thanks. I think I got it now! Thanks alot! :P |
|
RipullJoin Date: 2008-07-21 Post Count: 14249 |
local RemoveForceFields = function()
for i,v in pairs(game.Players:GetPlayers()) do
if( v.Character )then
if( v.Character:FindFirstChild("ForceField") )then
v.Character.ForceField:Destroy();
end;
end;
end;
end;
--Put this function at the beginning of your script.
--Now, when you want to use this, simply say RemoveForceFields() on your desired line. |
|