|
How would I make a forcefeild script for only me on enter? |
|
|
YoName = "xxCOSMICxx"
game.Players.PlayerAdded:connect(function(v)
if v.Name == YoName then
repeat
wait();
untill v.Character
Instance.new("ForceField").Parent = v.Character;
end
end)
|
|
|
function onEnter(newPlyr)
if newPlyr.Name == xxCOSMICxx then
Instance.new("ForceField",newPlyr)
end
end
game.Players.PlayerAdded:connect(onEnter) |
|
|
|
DidYouSeeThatDog's is better, it waits for the character so that it won't error. |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
yoname = "NAME"
game.Players.PlayerAdded:connect(function(plyr)
plyr.CharacterAdded:connect(function(char)
if char.Name == yoname then
Instance.new("ForceField", char)
end
end)
end)
:D |
|
|
and now zeke's is better, because it would happen every time you respawn, along with the first time you enter the game. |
|
|
'DidYouSeeThatDog's is better,'
BOOHYEAH!
(clears throught)
um yea, thanks.
(goes back to writing x86) |
|
|
yoname = "NAME"
game.Players.PlayerAdded:connect(function(plyr)
if plyr.Name == yoname then
plyr.CharacterAdded:connect(function(char)
Instance.new("ForceField", char)
end)
end
end)
-- doesn't connect a function to EVERY player, making it more efficient :3 |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
@DYSTD
...not really. Well, I guess. But mine would still work just as good as that. |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
ONE LINE, BOOYAH:
yoname = "NAME" game.Players.PlayerAdded:connect(function(plyr) if plyr.Name == yoname then plyr.CharacterAdded:connect(function(char) Instance.new("ForceField", char) end) end end) |
|
|
|
Narbcake, lua (like most languaes (if not all)) ignores white space ( spaces, new lines, stuff like that), so they will all be interpeted as 1 line.
Also, mine is still better, because like I said, it only connects an event (WHICH IS PRESIOUS MEMORY) to the required person. |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
yoname = "xxCOSMICxx"
game.Players.PlayerAdded:connect(function(plyr)
if plyr.Name == yoname then
plyr.CharacterAdded:connect(function(char)
Instance.new("ForceField", char)
end)
end
end) |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
@DYSTD
It would still work, narbcake. :3
If it doesn't explain how my SB works. :D |
|
|
I know it would work, I'm saying removing all the -ignored- whitespace does nothing, and copying mine ish mean >:O |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
I didn't copy. :< |
|
|
Ok I copyed it and put my name were im suppose to i saved the game left and went back in then it dinent work i checed explorer>workspace and script was gone |
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
Your script must have archivable unchecked. |
|
|
|
zeke505Join Date: 2008-05-26 Post Count: 15765 |
Oh, erm...
I dunno then. :P |
|
|
and like he said, it must be un checked. note the "un" prefix. |
|
|
Its checked prefix "ch"ecked |
|
|
do you know what a prefix is? and can you understand english? make it so that there's no check in the little box next to archivable. |
|