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 » Scripters
Home Search
 

Re: Is my ~ statement wrong?

Previous Thread :: Next Thread 
haydebug2003 is not online. haydebug2003
Joined: 21 Jan 2012
Total Posts: 5302
12 Mar 2015 09:32 PM
script.Parent.MouseClick:connect(function(ClickParent)
player1=false
if player1==false then
if game.Workspace.Player1Storage.Full.Value==0 then
print(ClickParent)
ClickParent.Character.Humanoid.WalkSpeed=0
ClickParent.Character:MoveTo(game.Workspace.Player1Storage.Position)
print("Player1Storage is now full")
game.Workspace.Player1Storage.Full.Value=2
game.Workspace.Player1Storage.Player1.Value=ClickParent.Name
player1=true
elseif game.Workspace.Player1Storage.Full.Value==1 then
print("PlayerStorage1 Is Full")
end
end
if player1==false then
if game.Workspace.Player1Storage.Player1.Value~=ClickParent and game.Workspace.Player2Storage.Full.Value==0 then
-- I need the help right here. It still teleports them even if they are the value.
ClickParent.Character.Humanoid.WalkSpeed=0
print(ClickParent)
ClickParent.Character:MoveTo(game.Workspace.Player2Storage.Position)
print("Player2Storage is now full")
game.Workspace.Player2Storage.Full.Value=2
game.Workspace.Player2Storage.Player2.Value=ClickParent.Name
elseif game.Workspace.Player2Storage.Full.Value==1 then
print("PlayerStorage1 Is Full")
end
end
end)


I dont know what is wrong at the part "if game.Workspace.Player1Storage.Player1.Value~=ClickParent and game.Workspace.Player2Storage.Full.Value==0 then". I need the help right here. It still teleports them even if they are the value.


[Haydebug2003] [LMaDer]
Report Abuse
haydebug2003 is not online. haydebug2003
Joined: 21 Jan 2012
Total Posts: 5302
12 Mar 2015 09:33 PM
1


[Haydebug2003] [LMaDer]
Report Abuse
haydebug2003 is not online. haydebug2003
Joined: 21 Jan 2012
Total Posts: 5302
12 Mar 2015 09:35 PM
2


[Haydebug2003] [LMaDer]
Report Abuse
MaxisBL is not online. MaxisBL
Joined: 23 Dec 2010
Total Posts: 6
12 Mar 2015 09:37 PM
I think that ClickParent or Player2Storage may not have the correct value. Without knowing your exact object hierarchy/structure, I don't think I can help as your code appears to not have any errors.
Although, you could try adding a space before and after the ~=.
Report Abuse
haydebug2003 is not online. haydebug2003
Joined: 21 Jan 2012
Total Posts: 5302
12 Mar 2015 09:39 PM
Maxis my layout for my storage is Player2Storage['Player2','Full']


[Haydebug2003]
Report Abuse
Hunter4529 is not online. Hunter4529
Joined: 20 Oct 2013
Total Posts: 675
12 Mar 2015 09:39 PM
Its probably a logic error. Is it possible that the value could have different capitalization?
Report Abuse
haydebug2003 is not online. haydebug2003
Joined: 21 Jan 2012
Total Posts: 5302
12 Mar 2015 09:41 PM
I think it is perhaps I forgot to do clickparent.name


[Haydebug2003]
Report Abuse
haydebug2003 is not online. haydebug2003
Joined: 21 Jan 2012
Total Posts: 5302
12 Mar 2015 09:41 PM
That was the error. Everything works fine now guys, thanks for the help!!


[Haydebug2003]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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