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: Why Doesn't this work?

Previous Thread :: Next Thread 
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
03 Oct 2013 07:28 PM
The script works except it doesn't change my health. This is in a LocalScript.

function GodMode(Player)
print("Called")

Player.Character.Humanoid.MaxHealth = math.huge
end

Output: > Called
Report Abuse
FrozenSmite is not online. FrozenSmite
Joined: 17 Jul 2013
Total Posts: 2242
03 Oct 2013 07:30 PM
Call the function/connect

♫♪ repeat wait() until game.Players.FrozenSmite.HasALife == true ♪♫
Report Abuse
FrozenSmite is not online. FrozenSmite
Joined: 17 Jul 2013
Total Posts: 2242
03 Oct 2013 07:31 PM
Nvm lol

♫♪ repeat wait() until game.Players.FrozenSmite.HasALife == true ♪♫
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
03 Oct 2013 07:31 PM
You define "Player".
Report Abuse
Xeptix is not online. Xeptix
Joined: 14 Mar 2013
Total Posts: 1115
03 Oct 2013 07:34 PM
He does call it, and Player is defined...
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
03 Oct 2013 07:34 PM
Player is defined.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
03 Oct 2013 07:35 PM
When he calls it though, what is the argument he puts in?

GodMode(game.Players.LocalPlayer)?
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
03 Oct 2013 07:35 PM
Here is more of the script:
self = game.Players.LocalPlayer

function GodMode(Player)
print("Called")

Player.Character.Humanoid.MaxHealth = math.huge
end

GodMode(self)
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
03 Oct 2013 07:36 PM
Is this in a LocalScript?
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
03 Oct 2013 07:37 PM
Yes...
Report Abuse
Xeptix is not online. Xeptix
Joined: 14 Mar 2013
Total Posts: 1115
03 Oct 2013 07:37 PM
Are you people blind?!

He clearly said "This is in a LocalScript."
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
03 Oct 2013 07:38 PM
Where is it located? Is this connected to an event, or does it just run whenever it's created?

If it just runs without waiting for a certain event to happen, try putting repeat wait() until game.Players.LocalPlayer at the top.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
03 Oct 2013 07:39 PM
Oops, I didn't see that part where he mentioned it was in a LocalScript at first post, sorry,
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
03 Oct 2013 07:39 PM
Well if I posted the entire script it's over 1K lines. :P Its the main script for my game.
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