|
| 05 Dec 2014 06:13 PM |
The smoke doesn't appear, but I don't get any errors..
game.Workspace.BasePlate.Touched:connect(function(baseplate) local plr = baseplate.Parent:findFirstChild("Humanoid") if baseplate.Material == Enum.Material.Grass then plr = plr.Parent:findFirstChild("Left Leg" or "Right Leg") local smoke = Instance.new("Smoke", plr) wait(1) smoke:Remove() end end)
#DurstIlluminati (ROBUX: R$72,149) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 05 Dec 2014 06:14 PM |
plr = plr.Parent:findFirstChild("Left Leg" or "Right Leg")
i lold |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:15 PM |
dude, I'm a new scripter..
#DurstIlluminati (ROBUX: R$72,168) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 05 Dec 2014 06:15 PM |
so, its still a funny mistake, no matter if your new or not the fact that you are new just explains why you did the mistake |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:18 PM |
you're*
oh, that's just a funny mistake.
#DurstIlluminati (ROBUX: R$72,253) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 05 Dec 2014 06:20 PM |
| so you don't want me to tell you how to fix the problem? |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:21 PM |
kfein, is this better..?
plr = plr.Parent:findFirstChild("Left Leg") or plr.Parent:findFirstChild("Right Leg")
#DurstIlluminati (ROBUX: R$72,357) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:21 PM |
i'd like a fix, but you decided to mock me over me still learning..
#DurstIlluminati (ROBUX: R$72,357) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 05 Dec 2014 06:22 PM |
yes, that is good! i guess you know how the or operator works, so yeah, well done. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:22 PM |
. _ .
#DurstIlluminati (ROBUX: R$72,364) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:23 PM |
okay, so what about the rest?
#DurstIlluminati (ROBUX: R$72,364) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:23 PM |
| Everytime someone uses "or" or "and" like that, I silently think to myself "Man, I wish it was that simple". |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:25 PM |
well, what about the rest of the script?
#DurstIlluminati (ROBUX: R$72,381) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 05 Dec 2014 06:27 PM |
you can use "or" and "and" operators at many points in lua, quite useful feature, especially when it comes to defining variables
char = game.Players.LocalPlayer or "not found" |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:29 PM |
LocalPlayer can also be done in a main script.
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) -- This is the "LocalPlayer".
#DurstIlluminati (ROBUX: R$72,433) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:30 PM |
Just thought I'd say. xd
#DurstIlluminati (ROBUX: R$72,433) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 05 Dec 2014 06:30 PM |
"x and y" is basically this: if x == true then return y else return x end
"x or y": if x == true then return x else return y end
Helpful for shortcircuiting :D
@breuning: ew is your "char" variable's data type a Player object or a string? Best not to mix them even if Lua allows you to |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:34 PM |
I am asking for a script fix here, yanno..
#DurstIlluminati (ROBUX: R$72,450) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:35 PM |
game.Workspace.BasePlate.Touched:connect(function(baseplate) local plr = baseplate.Parent:findFirstChild("Humanoid") if baseplate.Material == Enum.Material.Grass then plr = plr.Parent:findFirstChild("Left Leg") or plr.Parent:findFirstChild("Right Leg") local smoke = Instance.new("Smoke", plr) end end)
#DurstIlluminati (ROBUX: R$72,450) (RAP: 617,588) |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 08 Dec 2014 10:52 AM |
@Dr01d
print(type(char))
;) |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2014 10:57 AM |
workspace.BasePlate.Touched:connect(function(hit) local plr = hit.Parent:findFirstChild("Humanoid") if hit.Material == Enum.Material.Grass then plr = plr.Parent:findFirstChild("Left Leg") or plr.Parent:findFirstChild("Right Leg") local smoke = Instance.new("Smoke", plr) end end)
--ThatChristianGuy |
|
|
| Report Abuse |
|
|