|
| 22 Oct 2010 03:40 PM |
function onPlayerRespawned(newplayer) if newplayer:findFirstChild("Humanoid") then b = Instance.new("Forcefield") b.Parent = newplayer.Character end end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
It should give you a forcefield when you spawn. |
|
|
| Report Abuse |
|
|
iownedu89
|
  |
| Joined: 18 May 2009 |
| Total Posts: 586 |
|
|
| 22 Oct 2010 03:42 PM |
function onPlayerRespawned(newplayer) if newplayer:findFirstChild("Humanoid") then b = Instance.new("Forcefield") b.Parent = newplayer end end
game.Workspace.ChildAdded:connect(onPlayerRespawned) |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:43 PM |
| Don't you already get a forcefield when you respawn? |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Oct 2010 03:44 PM |
h = newplayer:findFirstChild("Humanoid")
function onPlayerRespawned(newplayer) if h ~= nil then b = Instance.new("ForceField") b.Parent = newplayer.Character end end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
--not sure, never did anythin like this, but 1 mistake is ForceField, F wasnt capitalized.
|
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Oct 2010 03:45 PM |
@crazypotato4
Yes, you get forcefield, but if there is no Spawn, then you don't. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:46 PM |
| Of course...Capitalization is my mistake..Again. >.< |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:46 PM |
| Lol, shouldn't you already have a ForceField when you respawn?? |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:47 PM |
| Although it still doesn't work. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:48 PM |
Flappy, I want the Forcefield to go on until it is removed.
game.Workspace.FloodCheck:Remove() Hate it. |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Oct 2010 03:48 PM |
Try this: ---------------------------------------------------------------------------------
h = newplayer:findFirstChild("Humanoid")
function onPlayerRespawned(newplayer) if h ~= nil then b = Instance.new("ForceField") b.Parent = newplayer.Character end end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
If that won't work try this below: ----------------------------------------------------------------------------------
function onPlayerRespawned(newplayer) if newplayer:findFirstChild("Humanoid") then b = Instance.new("ForceField") b.Parent = newplayer.Character end end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
|
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:51 PM |
Alright, this is a script that DID work, but it gave me a forcefield forever, I couldn't remove it, the script just put in a new one.
while wait() do for i,v in pairs(game.Players:GetPlayers()) do repeat wait() until v.Character if v.Character:findFirstChild("ForceField") == nil then Instance.new("ForceField",v.Character) end end end
Could someone edit it so it doesn't come back until you respawn? |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Oct 2010 03:53 PM |
| Im not sure, i would of make a big GUI screen "Press to continue" and when you press then it gives you FF and removes the GUI. xD |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Oct 2010 03:55 PM |
| Oh and that script that worked is set if it is nil then it inserts, so whenever you remove ForceField, it inserts new. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:56 PM |
| Well, that script is a little complicated for me, could you edit it to only give you one when you respawn? |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Oct 2010 03:57 PM |
@Crni Any of your scripts will work, you only have newPlayer defined inside the function... so you 'h' is a nil value. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 03:59 PM |
You people aren't very good at this, are you?
function onPlayerRespawned(newplayer) if newplayer:findFirstChild("Humanoid") == nil then --if the forcefield ISNT ALREADY THERE. b = Instance.new("ForceField", newplayer) -- NEWPLAYER IS THE CHARACTER. end end
game.Workspace.ChildAdded:connect(onPlayerRespawned) |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Oct 2010 04:00 PM |
| Lol, i was about to post that xD |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2010 04:00 PM |
ohwait, logic fail on my part.
function onPlayerRespawned(newplayer) if newplayer:findFirstChild("Humanoid") then b = Instance.new("ForceField:, newplayer) -- STILL THE SAME end end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
Thought you were checking for the forcefield, not the humanoid ;P |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Oct 2010 04:00 PM |
| Hey crazy >3 just a few more posts till 4k |
|
|
| Report Abuse |
|
|
| |
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Oct 2010 04:01 PM |
function onPlayerRespawned(newplayer) if newplayer:findFirstChild("Humanoid") then b = Instance.new("ForceField", newplayer) -- STILL THE SAME end end
game.Workspace.ChildAdded:connect(onPlayerRespawned)
-- As long i know, you can not close a " with a :. |
|
|
| Report Abuse |
|
|
| |
|
chris1989
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 2520 |
|
|
| 22 Oct 2010 04:06 PM |
You all fail...
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) Instance.new("ForceField" c) end) end) |
|
|
| Report Abuse |
|
|
harutsedo
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 5150 |
|
|
| 22 Oct 2010 04:07 PM |
As do you.
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) Instance.new("ForceField", c) end) end) |
|
|
| Report Abuse |
|
|
| |
|