miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 10:16 AM |
myTable = {"No one owns this1","No one owns this2","No one owns this3","No one owns this4","No one owns this5","No one owns this6","No one owns this7","No one owns this8"}
Ok, I made a script using this table.The thing is I KNOW it doesn't make sense because I said
game.Workspace.myTable
And yes, I know myTable isn't valid of Workspace.But the things INSIDE the table are.Can someone explain how I can make the things in the Table valid?I ain't the best at tables :P |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Sep 2011 10:18 AM |
myTable = {"No one owns this1","No one owns this2","No one owns this3","No one owns this4","No one owns this5","No one owns this6","No one owns this7","No one owns this8"}
c = workspace:children() for i = 1, #myTable do for k = 1, #c do if c[k].Name == #myTable[i] then --stuff end end end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 10:22 AM |
WHat you mean by stringvalue?Well, I know what you mean but why should I use it? @Cachinnation
Is there another way, just askin... |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2011 10:23 AM |
| You could use the for loop. And what you exactly doing? Trying to remove it? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 10:30 AM |
Here's the whole script.
myTable = {"No one owns this1","No one owns this2","No one owns this3","No one owns this4","No one owns this5","No one owns this6","No one owns this7","No one owns this8"} for i,v in pairs (game.Workspace.myTable:GetChildren()) do game.Workspace.myTable.Touched:connect(function(hit) if hit.Name == game.Players.Player then for i = 1,#myTable do game.Workspace.myTable.Name = "Player" game.Workspace.myTable.Head.CanCollide = false game.Workspace.myTable.Head.Transparency = 1 wait(1) game.Workspace.myTable.Head.CanCollide = true game.Workspace.myTable.Head.Transpareny = 0 end end end) end
If a player touches any of the myTable things in workspace there name changes the the models name.But it doesnt work because myTable isn't valid of workspace. |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2011 10:32 AM |
myTable = {"No one owns this1","No one owns this2","No one owns this3","No one owns this4","No one owns this5","No one owns this6","No one owns this7","No one owns this8"}
for i,v in pairs(myTable) do
game.Workspace[v].Touched:connect(function(hit) game.Workspace[v].Name = hit.Parent.Name game.Workspace[v].Head.CanCollide = false game.Workspace[v].Head.Transparency = 1 wait(1) game.Workspace[v].Head.CanCollide = true game.Workspace[v].Head.Transpareny = 0 end) end
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 10:38 AM |
-__- This makes no sense!
Ok, first of all I said game.Workspace[v].Head.Touched:connect(function(hit) I said that because the myTables are models.Second this is what the output said -__-
No one owns this5 is not a valid member of Workspace
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2011 10:41 AM |
^.^ I wanna BUMP and BUMP all night.
~I was there... |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 10:43 AM |
That sounds weird and suspicious.
Btw STOP POSTING ON MAH THREAD UNLESS YOU GOT SOMETHING TO SAY TO FIX THE SCRIPT :P
Someone had there cocoa puffs =_= |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 11:01 AM |
Ok, the script works where it says the players name but It's not changing canCollide and transparency :o |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 10 Sep 2011 11:04 AM |
game.Workspace[v].Touched:connect(function(hit) game.Workspace[v].Head.CanCollide = false game.Workspace[v].Head.Transparency = 1 wait(1) game.Workspace[v].Head.CanCollide = true game.Workspace[v].Head.Transpareny = 0 game.Workspace[v].Name = hit.Parent.Name end) end
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 11:14 AM |
Output Touched is not a valid memeber of model |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 11:17 AM |
| Thanks a lot smurf!YOu made it worse!!!! |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Sep 2011 11:48 AM |
myTable = {"No one owns this1","No one owns this2","No one owns this3","No one owns this4","No one owns this5","No one owns this6","No one owns this7","No one owns this8"}
for i, v in pairs(myTable) do print(game.Workspace[v]) end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 06:44 PM |
| I don't wanna print it -__- |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 06:49 PM |
| Oh ok, yeah I know what's wrong.This makes no sense!When I printed What spectrum said it only printed four of the tables.Why?It makes no sense! |
|
|
| Report Abuse |
|
|
ItRPieMan
|
  |
| Joined: 08 Sep 2011 |
| Total Posts: 115 |
|
|
| 10 Sep 2011 06:57 PM |
use this:
table={workspace.Model1,workspace.Model2,workspace.Model3} |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Sep 2011 07:12 PM |
| No, It worked.But the cancollide and transparency didn't change. |
|
|
| Report Abuse |
|
|