|
| 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 |
|
|
| |
|
| |
|
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 |
|
|
|
| 12 Mar 2015 09:39 PM |
Maxis my layout for my storage is Player2Storage['Player2','Full']
[Haydebug2003] |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2015 09:39 PM |
| Its probably a logic error. Is it possible that the value could have different capitalization? |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2015 09:41 PM |
I think it is perhaps I forgot to do clickparent.name
[Haydebug2003] |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2015 09:41 PM |
That was the error. Everything works fine now guys, thanks for the help!!
[Haydebug2003] |
|
|
| Report Abuse |
|
|