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: Health/walkspeed changing help?

Previous Thread :: Next Thread 
StealthFreddy is not online. StealthFreddy
Joined: 07 Sep 2011
Total Posts: 7011
07 Oct 2013 07:24 PM
ok so i want this scripts to change health/maxhealth/walkspeed... here it is:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)

character.Humanoid.MaxHealth = 1000

character.Humanoid.WalkSpeed = 25

character.Humanoid.Health = 1000

end)
end)
Report Abuse
StealthFreddy is not online. StealthFreddy
Joined: 07 Sep 2011
Total Posts: 7011
07 Oct 2013 07:26 PM
also, this is a Local Script in Workspace.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
07 Oct 2013 07:27 PM
LocalScripts don't run in Workspace, only on the client, e.g. Backback [StarterPack], PlayerGui [StarterGui], Player, etc. Workspace is server-side.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
07 Oct 2013 07:27 PM
Ergo, change it to a regular Script.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
07 Oct 2013 07:29 PM
It won't work
Report Abuse
StealthFreddy is not online. StealthFreddy
Joined: 07 Sep 2011
Total Posts: 7011
07 Oct 2013 07:32 PM
well would you tell me WHY it won't work? -.- also changed it into a regular script.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
07 Oct 2013 07:33 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)

character.Humanoid.MaxHealth = 1000

character.Humanoid.WalkSpeed = 25

character.Humanoid.Health = 1000

end)
end)

Well, it will work since you changed it to a normal script. But it might not.
You should make sure Humanoid exists, use WaitForChild or something
Report Abuse
StealthFreddy is not online. StealthFreddy
Joined: 07 Sep 2011
Total Posts: 7011
07 Oct 2013 07:39 PM
like WaitforChild("Humanoid")?

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)

character:WaitForChild("Humanoid")

character.Humanoid.MaxHealth = 1000

character.Humanoid.WalkSpeed = 25

character.Humanoid.Health = 1000

end)
end)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
07 Oct 2013 07:40 PM
Yeah
Report Abuse
ilikepiehaha is not online. ilikepiehaha
Joined: 02 Aug 2011
Total Posts: 316
07 Oct 2013 07:52 PM
game.Players.PlayerAdded:connect(function(plr)
if plr then
char = plr.Character
hum = char.Humanoid
hum.MaxHealth = 1000
hum.Health = 1000
hum.WalkSpeed = 25
end
end)

You can only access a player's character through plr.Character, eg the player's Character property. There is no CharacterAdded method.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
07 Oct 2013 07:53 PM
Yes there is -.-
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
08 Oct 2013 01:53 AM
lol`d
soon as I saw that I knew that if I would see the "-.-" or the ".-." face.
Report Abuse
ilikepiehaha is not online. ilikepiehaha
Joined: 02 Aug 2011
Total Posts: 316
08 Oct 2013 04:30 PM
Woops, terribly sorry. I thought he was referring to the Players list, ie game.Players, rather than the player itself. I have that issue alot thus I use plr as my variable. Sorry about that.
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