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: Tables

Previous Thread :: Next Thread 
miz656 is not online. 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
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
10 Sep 2011 10:17 AM
StringValue? D:
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
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 is not online. 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
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
10 Sep 2011 10:23 AM
You could use the for loop. And what you exactly doing? Trying to remove it?
Report Abuse
miz656 is not online. 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
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
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 is not online. 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
jessemccullough9292 is not online. jessemccullough9292
Joined: 10 Jul 2008
Total Posts: 590
10 Sep 2011 10:41 AM
^.^
I wanna BUMP and BUMP all night.

~I was there...
Report Abuse
miz656 is not online. 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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
10 Sep 2011 10:56 AM
Anyone know :O
Report Abuse
miz656 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
10 Sep 2011 06:44 PM
I don't wanna print it -__-
Report Abuse
miz656 is not online. 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 is not online. 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 is not online. 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
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