djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 12 Jul 2013 10:45 PM |
I want to understand how to use variables I know that if i said X = Torso That would make X the torso value. But how would i use this in a script? such as game.Workspace.Player1.X.Transparency = 1 |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 12 Jul 2013 10:54 PM |
| Please some one tell me :c |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 12 Jul 2013 10:56 PM |
Lol, you have 69 posts.
And you could just do:
X.Transparency = 1 game.Workspace.Player1[X.Name].Transparency = 1 |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 12 Jul 2013 10:59 PM |
| i dont understand? is X.Transparency = 1 With that bottem one? and if so What is [X.Name] supose to do |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2013 11:03 PM |
X = workspace.Part
X:Destroy() |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 12 Jul 2013 11:05 PM |
@dj, they both do the same thing.
You can do a lot with variables. Like this:
variable1 = "Hai" variable2 = "Bye" variable3 = ":("
table = {variabel1,variable2,variable3} for i,v in pairs(table) do print(v) end |
|
|
| Report Abuse |
|
|
|
| 12 Jul 2013 11:08 PM |
| No offence Zach but concidering he doesn't know how to use basic variables, I don't think giving him tables and stuff is going to help very well. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 12 Jul 2013 11:11 PM |
| Yeah probably, but I was just trying to give an example he could try to examine. Even if it's a bit advanced for him. |
|
|
| Report Abuse |
|
|
clanky4
|
  |
| Joined: 21 Oct 2009 |
| Total Posts: 389 |
|
|
| 12 Jul 2013 11:12 PM |
Variables are just a way to make writing a script shorter.
For instance you could have a relatively long ancestry that you would need to use several times.
local thebagel = Part local ilovetheninties = game.Workspace:FindFirstChild(thebagel)
if ilovetheninties ~= nil then --you could just put if ilovetheninties then ilovetheninties.Parent = nil |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
| |
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 12 Jul 2013 11:47 PM |
x = game.Workspace.Baseplate
while true do wait(0.1) x.Transparency = 1 wait(5) x.Transparency = 0 end
I hope this helped. |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 12 Jul 2013 11:50 PM |
That did help i kinda get it but why cant i just use this
x = Torso
while true do game.Workspace.Player1.x.Transparency = 1 wait(1) game.Workspace.Player1.x.Transparency = 0 end
Btw why do u need while true do? |
|
|
| Report Abuse |
|
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 12 Jul 2013 11:53 PM |
You could do
x = game.Workspace.djboy.Torso
wait(0.1) x.Transparency = 1
But I like doing while true do because it will make the transparency loop. |
|
|
| Report Abuse |
|
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 12 Jul 2013 11:55 PM |
| When ever scripting remember to type it like it says in game. So it's not torso it's Torso |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 12 Jul 2013 11:55 PM |
| But on the true part, Where in the script is there True? |
|
|
| Report Abuse |
|
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 12 Jul 2013 11:56 PM |
| Don't worry about it. There will be a error if you do "while do" you have to type "while true do". |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 13 Jul 2013 12:14 AM |
What if i wanted to do this x = Transparency = 1 How would i do that? |
|
|
| Report Abuse |
|
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
| |
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 13 Jul 2013 12:28 AM |
| Have any more questions before I go back to building? |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 13 Jul 2013 12:32 AM |
| yea instead of x=game.Workspace.Player.Torso how do i do Right arm or Left leg etc |
|
|
| Report Abuse |
|
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 13 Jul 2013 12:43 AM |
Hmm... Let see if I can remember how to do that.'
You would then have to do 2.
g = game.Workspace.thombot2 x = p:FindFirstChild("Left Arm")
wait(0.1) x.Transparency = 1 |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2013 12:44 AM |
| @Thom you forgot to describe p :P |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 13 Jul 2013 12:46 AM |
| canada can u tell me instead? |
|
|
| Report Abuse |
|
|
thombot2
|
  |
| Joined: 15 Oct 2008 |
| Total Posts: 104 |
|
|
| 13 Jul 2013 12:46 AM |
| XD Sorry change p to a g.... I typed it wrong. |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 13 Jul 2013 12:49 AM |
Wpuldent it have to be wait(0.1) g.x.Transparency = 1 |
|
|
| Report Abuse |
|
|