Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 14 May 2014 03:15 PM |
Well, I've been to scripting helpers before. They gave me a script, it did not work. I have no idea why since output gave me nothing. I gave up and tried to rescript it myself. --------------------------------------------------------------------------- --------------------------------------------------------------------------- A=game.Workspace.BuildingAreas.Area1.Player.Value B=game.Workspace.BuildingAreas.Area2.Player.Value C=game.Workspace.BuildingAreas.Area3.Player.Value D=game.Workspace.BuildingAreas.Area4.Player.Value E=game.Workspace.BuildingAreas.Area5.Player.Value F=game.Workspace.BuildingAreas.Area6.Player.Value G=game.Workspace.BuildingAreas.Area7.Player.Value H=game.Workspace.BuildingAreas.Area8.Player.Value I=game.Workspace.BuildingAreas.Area9.Player.Value J=script.Parent K=game.Players.LocalPlayer.Name
function click() if A=K then do game.Workspace.BuildingAreas.Area1.BasePlate.Material="Brick" elseif if B=K then do game.Workspace.BuildingAreas.Area2.BasePlate.Material="Brick" elseif if C=K then do game.Workspace.BuildingAreas.Area3.BasePlate.Material="Brick" elseif if D=K then do game.Workspace.BuildingAreas.Area4.BasePlate.Material="Brick" elseif if E=K then do game.Workspace.BuildingAreas.Area5.BasePlate.Material="Brick" elseif if F=K then do game.Workspace.BuildingAreas.Area6.BasePlate.Material="Brick" elseif if G=K then do game.Workspace.BuildingAreas.Area7.BasePlate.Material="Brick" elseif if H=K then do game.Workspace.BuildingAreas.Area8.BasePlate.Material="Brick" elseif if I=K then do game.Workspace.BuildingAreas.Area9.BasePlate.Material="Brick" end end
J.MouseButton1Down:connect(click)
---------------------------------------------------------------- ---------------------------------------------------------------- Basically, that if the Value in game.Workspace.BuildingAreas.Area# is the same as the LocalPlayer name then it changes that specific BasePlate to the brick material. It's inside a button and I'm gonna do it for each material and put it in each material button. ----------------------------------------------------------------- Here's the script that they gave me before which did not work. -----------------------------------------------------------------
p = {} for i=1,9 do table.insert(p,game.Workspace.BuildingAreas["Area"..i].Player.Value) end
script.Parent.MouseButton1Down:connect(function() for i=1,#p do if game.Players.LocalPlayer.Name == p[i] then game.Workspace.BuildingAreas["Area"..i].BasePlate.Material = "Brick" end end end) |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 14 May 2014 03:46 PM |
yey verifiedname is online he's great at helping |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
|
| 14 May 2014 03:52 PM |
| He doesnt help he criticizes |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 14 May 2014 03:53 PM |
| he seemed to help me pretty well last time |
|
|
| Report Abuse |
|
|
Zeloi
|
  |
| Joined: 27 Sep 2010 |
| Total Posts: 1143 |
|
|
| 14 May 2014 03:53 PM |
First off if A=K then??
no if A==K then |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 03:53 PM |
| All of your if..then statements check correctly except you need '==' instead of '='. |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 14 May 2014 04:00 PM |
A=game.Workspace.BuildingAreas.Area1.Player.Value B=game.Workspace.BuildingAreas.Area2.Player.Value C=game.Workspace.BuildingAreas.Area3.Player.Value D=game.Workspace.BuildingAreas.Area4.Player.Value E=game.Workspace.BuildingAreas.Area5.Player.Value F=game.Workspace.BuildingAreas.Area6.Player.Value G=game.Workspace.BuildingAreas.Area7.Player.Value H=game.Workspace.BuildingAreas.Area8.Player.Value I=game.Workspace.BuildingAreas.Area9.Player.Value J=script.Parent K=game.Players.LocalPlayer.Name
function click() if A==K then game.Workspace.BuildingAreas.Area1.BasePlate.Material="Brick" elseif if B==K then game.Workspace.BuildingAreas.Area2.BasePlate.Material="Brick" elseif if C==K then game.Workspace.BuildingAreas.Area3.BasePlate.Material="Brick" elseif if D==K then game.Workspace.BuildingAreas.Area4.BasePlate.Material="Brick" elseif if E==K then game.Workspace.BuildingAreas.Area5.BasePlate.Material="Brick" elseif if F==K then game.Workspace.BuildingAreas.Area6.BasePlate.Material="Brick" elseif if G==K then game.Workspace.BuildingAreas.Area7.BasePlate.Material="Brick" elseif if H==K then game.Workspace.BuildingAreas.Area8.BasePlate.Material="Brick" elseif if I==K then game.Workspace.BuildingAreas.Area9.BasePlate.Material="Brick" end end
J.MouseButton1Down:connect(click)
=========================================================== New script. I removed the do's as well. I thought they might be unnecessary. I'm getting an error on "if B==K then" with the red squiggly lines. |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 04:02 PM |
A=game.Workspace.BuildingAreas.Area1.Player.Value B=game.Workspace.BuildingAreas.Area2.Player.Value C=game.Workspace.BuildingAreas.Area3.Player.Value D=game.Workspace.BuildingAreas.Area4.Player.Value E=game.Workspace.BuildingAreas.Area5.Player.Value F=game.Workspace.BuildingAreas.Area6.Player.Value G=game.Workspace.BuildingAreas.Area7.Player.Value H=game.Workspace.BuildingAreas.Area8.Player.Value I=game.Workspace.BuildingAreas.Area9.Player.Value J=script.Parent K=game.Players.LocalPlayer.Name
function click() if A==K then game.Workspace.BuildingAreas.Area1.BasePlate.Material="Brick" elseif B==K then game.Workspace.BuildingAreas.Area2.BasePlate.Material="Brick" elseif C==K then game.Workspace.BuildingAreas.Area3.BasePlate.Material="Brick" elseif D==K then game.Workspace.BuildingAreas.Area4.BasePlate.Material="Brick" elseif E==K then game.Workspace.BuildingAreas.Area5.BasePlate.Material="Brick" elseif F==K then game.Workspace.BuildingAreas.Area6.BasePlate.Material="Brick" elseif G==K then game.Workspace.BuildingAreas.Area7.BasePlate.Material="Brick" elseif H==K then game.Workspace.BuildingAreas.Area8.BasePlate.Material="Brick" elseif I==K then game.Workspace.BuildingAreas.Area9.BasePlate.Material="Brick" end end J.MouseButton1Down:connect(click) |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 14 May 2014 04:05 PM |
Didn't work. Please don't tell me it's because the baseplate is locked. The baseplate I am trying to apply the material on is locked. PLEASE DON'T SAY IT'S BECAUSE OF THAT. I SPENT OVER 4 DAYS DYING THANKS TO THIS SCRIPT |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 04:07 PM |
are you sure all of those variables are correct?
|
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 14 May 2014 04:09 PM |
are you asking me if I'm defining an actual object in the game with those variables? Yeah.
in game.Workspace, there is a model called BuildingAreas. Inside that model is 9 models named Area1, Area2, Area3, etc. Inside each one of those is a String called "Player" which holds the player name of who owns the base. There's also a part called BasePlate inside the Areas which is supposed to change to the material. |
|
|
| Report Abuse |
|
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 15 May 2014 01:09 PM |
| anyone got any help they can give me? |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 15 May 2014 01:29 PM |
| If someone helps me with this script, I owe you so much. |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Vexedly
|
  |
| Joined: 15 Sep 2006 |
| Total Posts: 7011 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 15 May 2014 02:11 PM |
@vex i appreciate that very much, but it won't work :( |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Vexedly
|
  |
| Joined: 15 Sep 2006 |
| Total Posts: 7011 |
|
| |
|
Vexedly
|
  |
| Joined: 15 Sep 2006 |
| Total Posts: 7011 |
|
| |
|