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: If Else

Previous Thread :: Next Thread 
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 03:42 PM
For some reason it executes the else statement while I am in the group(Output says nothing and this is not the whole script)...

if player.Character then
if (player:IsInGroup(418063)) then
player.Character.Health = 0

else
torso.CFrame = CFrame.new(Vector3.new(25.5, 13, 0.5))
script.Parent.Gui:clone().Parent = player.PlayerGui
end
end
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
07 Dec 2011 03:43 PM
Could you please give the entire function this is in? I have a feeling you just need a loop.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 03:46 PM
If you are in Play Solo mode, that is why. While testing, :IsInGroup() doesn't work, you'll have to publish it to find out.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 03:48 PM
@fail, hmmm what a descriptive name. I'm not it test, it's play. Here's the whole script:

script.Parent.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
torso = hit.Parent:FindFirstChild("Torso")
if player.Character then
if (player:IsInGroup(418063)) then
player.Character.Health = 0
else
torso.CFrame = CFrame.new(Vector3.new(25.5, 13, 0.5))
script.Parent.Gui:clone().Parent = player.PlayerGui
end
end
end)
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 03:50 PM
@drnewblet

How was I supposed to know you weren't in test mode? I can script better than you any day, and if your calling ME an epicfail, what does that make you? It's gotta be worse than what I am.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 03:52 PM
It's your fault for underestimating me in the first place. If you actually checked me out and done your research, you would've know that I know that.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 03:56 PM
Wtf? Underestimating you? Even if I did, I would be RIGHT. Why would I look up your whole history just to answer one thread? Seems stupid right? Of course you should know that feeling.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 04:00 PM
Not really, I research people all the time, you are very social, are a low experienced builder and scripter who has gotten away from constant free models.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 04:01 PM
Wow, the stalker can actually read! If I did that on you, how would it let me know that you weren't on Play Solo? See my point?
Report Abuse
Ilithidguard is not online. Ilithidguard
Joined: 30 Aug 2008
Total Posts: 913
07 Dec 2011 04:04 PM
Can you stop spamming this thread? Get over it and continue. What part of the script are you wondering about?
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 04:06 PM
Knowledge comes from interpretation of what you think they have done. If you have seen my scripts like I did yours, you would probably have guessed that I would have known that. You could have posted "Did you test it in Play Solo?" anyways.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 04:06 PM
He started it, sooo.....
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 04:07 PM
@1lith: Did you not read the post title? It says If Else, and in the post I specifically said that the If Else part wasn't working right.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 04:07 PM
Well sorry that I don't stalk people down to see if they are testing on Play Solo. My bad.

[/sarcasm]
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 04:12 PM
Epic if you can't help don't post.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Dec 2011 04:16 PM
Then why did you just post that, it didn't help.
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
07 Dec 2011 04:18 PM
@epic

he's the op. He cant help, hes the one asking for it so that was not a valid argument. Not trying to take sides BTW.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 04:27 PM
bump
Report Abuse
skipperguy12 is not online. skipperguy12
Joined: 09 Oct 2009
Total Posts: 955
07 Dec 2011 05:06 PM
I was going to help you.....but....reading what you did to everyone who tried to help you, i'm not going to help you... So far, all you did was flame the people who tried to help. NO ONE HELP. LET THE THREAD DIE.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 07:49 PM
Flaming - "The excuse people use when they have nothing good to say"

Report Abuse
Wehttam664 is not online. Wehttam664
Joined: 02 Oct 2009
Total Posts: 767
07 Dec 2011 08:11 PM
To be honest, I can't see an error in the code. There could be these few problems:
1. A brick hit it and the script attempted to get a player form it and failed.
2. That group doesn't exist or the numbers you have are off a bit.
3. The Roblox-LUA engine is broken... AGAIN. No soultion here.
Report Abuse
drmiewlo is not online. drmiewlo
Joined: 14 Mar 2012
Total Posts: 1782
07 Dec 2011 08:24 PM
I found the problem. Instead of Character.Health, it's Character.Humanoid.Health.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Dec 2011 01:40 PM
Herp a Derp.
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