generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Need some help (again)

Previous Thread :: Next Thread 
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 11:38 AM
The last two reset scripts that people helped me with never worked, so I need to get this to work this time.

function onEntered(Player)
player.Character.Humanoid.Health = 0
if (player) ~= nil then
end
end

Lombardo helped me with this script, but it is still not working. >.<

Any suggestions?
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 11:39 AM
This script is supposed to make the person reset when they enter the server, once.
Report Abuse
ChaosStar95 is not online. ChaosStar95
Joined: 19 Feb 2009
Total Posts: 5943
18 Jun 2012 11:43 AM
For one thing, you capitalized Player in the function but not in the body of the script... The script would see "Player" and "player" as two different variables.
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 11:46 AM
Typo, sorry, but overall, even with all the player's being typed as "Player" it still wouldn't work.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
18 Jun 2012 11:47 AM
game.Players.PlayerAdded:connect(function(newPlayer)
    repeat wait() until newPlayer.Character~=nil
    newPlayer.Character:BreakJoints()
end)

You had forgotten the connection line. Along with this, you capitalised player in the function yet not in the main script.

❈RAT: Director of Intra-Clan Affairs/Great Vilicus Admiral❈
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
18 Jun 2012 11:49 AM
"repeat wait() until newPlayer.Character~=nil"

Why not:
newPlayer.CharacterAdded:wait()

?
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 11:49 AM
Thank you cj, the RAT Admiral.
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 11:58 AM
Updated Script> Tools>Test> Play Solo> I didn't die.
>.<

The whole point of this is so I can reset when I enter my place and spawn at a [FOR] Team SpawnLocation. Should I just add this into my switch team script?

FOR = 582465

Hostile = 00000

local function onPlayerEntered(newPlayer)
if newPlayer:IsInGroup(FOR) then

newPlayer.TeamColor = game.Teams:FindFirstChild("Fighters Of Roblox").TeamColor

elseif newPlayer:IsInGroup(7013) then -- Other account is in RAT, bluh.

newPlayer.TeamColor = game.Teams:FindFirstChild("Allies").TeamColor
elseif newPlayer:IsInGroup(Hostile) then

newPlayer.TeamColor = game.Teams:FindFirstChild("Raiders").TeamColor
else newPlayer.TeamColor = game.Teams:FindFirstChild("Neutral").TeamColor
end
end

game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
18 Jun 2012 12:04 PM
FOR = 582465
Hostile = 00000
T = game.Teams

game.Players.PlayerAdded:connect(function(plyr)
plyr.CharacterAdded:wait()
if plyr:IsInGroup(FOR) then
plyr.TeamColor = T['Fighters Of Roblox'].TeamColor
elseif plyr:IsInGroup(7013) then
plyr.TeamColor = T['Allies'].TeamColor
elseif plyr:IsInGroup(Hostile) then
plyr.TeamColor = T['Raiders'].TeamColor
else
plyr.TeamColor = T['Neutral'].TeamColor
end
plyr.Character:BreakJoints()
end)

Maybe?
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 12:07 PM
I will see what I can do, thanks. Again.
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 12:11 PM
Nope. That just broke it entirely.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
18 Jun 2012 12:15 PM
Did you edit anything? Or are you getting any output?
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 12:21 PM
Lets see what happens when I add the respawn part of your version to mine.
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
18 Jun 2012 12:34 PM
Okay, this should work?
function onPlayerEntered(player)
if player:IsInGroup(whateverthegroupidis) then
player:BreakJoints()
player.TeamColor = BrickColor.new("whatevatheteamcolais")
else player:BreakJoints()
end
end


game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 01:16 PM
>.< In all ways, the original assign team script was the best. I just need a reset script that works. >.< Help is still needed.

function onEntered(newplayer)
newplayer.Character.Humanoid.Health = 0
if newplayer ~= nil then
end
end

Would this work?
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 01:20 PM
Quick correction,

game.Players.PlayerAdded:connect(onEntered)
Report Abuse
ExoCross is not online. ExoCross
Joined: 26 Jan 2011
Total Posts: 179
18 Jun 2012 01:23 PM
Game.Players.PlayerAdded:connect(function(newplayer)
newplayer.CharacterAdded:wait()
newplayer.Character:BreakJoints()
end)
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 01:30 PM
I never knew a simple reset script could be so confusing.
Report Abuse
Profucious is not online. Profucious
Joined: 28 May 2012
Total Posts: 6087
18 Jun 2012 01:37 PM
Output isn't giving me anything either. Bluh.
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
18 Jun 2012 01:43 PM
wait(1)
game.Player.PlayerAdded:connect(function(Player)
Player.CharacterAdded:wait()
if Player.Character:findFirstChild("Humanoid") then
Player.Character:BreakJoints()
end
end)

Worked for me.

--TehChikenHater ლ(ಠ_ಠლ)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image