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 » Scripters
Home Search
 

Re: Why isn't this working, or what have I done wrong?

Previous Thread :: Next Thread 
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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 is not online. 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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
05 Dec 2014 06:15 PM
dude, I'm a new scripter..


#DurstIlluminati (ROBUX: R$72,168) (RAP: 617,588)
Report Abuse
breuning is not online. 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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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 is not online. 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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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 is not online. 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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
05 Dec 2014 06:22 PM
. _ .


#DurstIlluminati (ROBUX: R$72,364) (RAP: 617,588)
Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
05 Dec 2014 06:23 PM
okay, so what about the rest?


#DurstIlluminati (ROBUX: R$72,364) (RAP: 617,588)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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 is not online. 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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
05 Dec 2014 06:30 PM
Just thought I'd say. xd


#DurstIlluminati (ROBUX: R$72,433) (RAP: 617,588)
Report Abuse
Dr01d3k4 is not online. 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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
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 is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
08 Dec 2014 10:52 AM
@Dr01d

print(type(char))

;)
Report Abuse
ThatChristianGuy is not online. ThatChristianGuy
Joined: 14 Jun 2014
Total Posts: 1283
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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