|
| 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 |
|
|
|
| 07 Oct 2013 07:26 PM |
| also, this is a Local Script in Workspace. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 07 Oct 2013 07:27 PM |
| Ergo, change it to a regular Script. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 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
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|