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 » Club Houses » Let's Make a Deal
Home Search
 

Re: How do I say "or" in lua

Previous Thread :: Next Thread 
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
14 Nov 2015 11:57 PM
Or something along the lines of that
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
14 Nov 2015 11:58 PM
if x == 2 or x == 3 then
print("x is equal to 2 or 3!!!")
end

it's literally the word or


#code R+ | local robux = "R$94,316"; local tix = "Tx98,606"
Report Abuse
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
14 Nov 2015 11:59 PM
Oh

lol
Report Abuse
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
15 Nov 2015 12:00 AM
sounds.victory.or.sounds.swish:Play()

The or has a red line qq
Report Abuse
BluesteelCrown is not online. BluesteelCrown
Joined: 19 Aug 2012
Total Posts: 26864
15 Nov 2015 12:00 AM
i need u 2 read this code and tell me if i did it right

if abstract == scammer or abstract == sharker then
print("scammer")
end
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
15 Nov 2015 12:02 AM
@Bluesteel

That code won't run... You need to add an else statement.


#code R+ | local robux = "R$94,316"; local tix = "Tx98,606"
Report Abuse
BluesteelCrown is not online. BluesteelCrown
Joined: 19 Aug 2012
Total Posts: 26864
15 Nov 2015 12:03 AM
aight thx
Report Abuse
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
15 Nov 2015 12:04 AM
Why does it have a red line under it now
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
15 Nov 2015 12:04 AM
What are you trying to do?


#code R+ | local robux = "R$94,316"; local tix = "Tx98,606"
Report Abuse
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
15 Nov 2015 12:05 AM
Make it so that when a goal is scored one of two sounds plays

I can only make it so that one plays without it breaking ://///
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
15 Nov 2015 12:06 AM
It doesn't work like that, lol...

Show me all of your code.


#code R+ | local robux = "R$94,316"; local tix = "Tx98,606"
Report Abuse
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
15 Nov 2015 12:07 AM
lol = script.Parent.Parent
brick = script.Parent
display = workspace.display
sounds = workspace.Sounds
whatever = game.Workspace
lmao = game.Lighting

function goal(hit)
local character = hit.Parent
if character.ClassName == "Hat" then
if character.Parent == whatever then
character:Remove()
wait()
else
wait()
end
elseif character and character:findFirstChild("Humanoid") then
character:moveTo(whatever.pos1.Position, whatever.pos1)
wait(0)
elseif character and character:findFirstChild("Handle") and whatever.shotclock.Value ~= 0 and whatever.time.Value ~= 0 and whatever.Music.Song2.IsPlaying == true and character.Name ~= "Guard" then

elseif character and character:findFirstChild("Handle") and whatever.time.Value ~= 0 and whatever.Music.Song2.IsPlaying == false and character.Name ~= "Guard" and whatever.quarter.Value ~= "P" and whatever.quarter.Value ~= "H" then
script.Disabled = true
whatever.STimer.Disabled = true
if character.TeamB.Value ~= lol.Team.Value then
lol.player.Value = character.player.Value
wait()
character.Parent=workspace
wait()
character:Remove()
whatever.RedPress.Transparency = 1
whatever.BluePress.Transparency = 1
whatever.timer.Disabled = true
sounds.Whistle:Play()
wait(0.5)
sounds.Whistle:Play()
wait(0.2)
display.Value = "False shooting (wrong hoop) " ..lol.player.Value.. "."
wait(3)
whatever.removal.Value = true
wait(0.5)
whatever.removal.Value = false
display.Value = ""
whatever.shotclock.Value = 20
c=game.Players:children()
for i=1, #c do
if c[i].TeamColor==BrickColor.new("Bright blue") then --Blue team
c[i].Character:moveTo(lmao.LBA_Ball11.Handle.Position,lmao.LBA_Ball11.Handle) --Position
elseif c[i].TeamColor==BrickColor.new("Bright red") then --Red team
c[i].Character:moveTo(workspace.pos1.Position, workspace.pos1) --Position
end
end
whatever.OOB1.Script.Disabled = true
wait(3)
sounds.Whistle:Play()
lmao.LBA_Ball11:clone().Parent = whatever
wait(4)
whatever.OOB1.Script.Disabled = false
whatever.timer.Disabled = false
whatever.STimer.Disabled = false
script.Disabled = false
elseif character.TeamB.Value == lol.Team.Value then
if lol.Under.Shot.Value==true then
lol.player.Value = character.player.Value
wait()
character.Parent=workspace
workspace.Game.scored.Value=true
whatever.RedPress.Transparency = 1
whatever.BluePress.Transparency = 1
whatever.timer.Disabled = true
sounds.Whistle:Play()
wait(0.5)
sounds.Whistle:Play()
wait(0.2)
display.Value = "Under Shot. [" ..lol.player.Value.. "]"
wait(3)
whatever.removal.Value = true
wait(0.5)
whatever.removal.Value = false
display.Value = ""
whatever.shotclock.Value = 26
c=game.Players:children()
for i=1, #c do
if c[i].TeamColor==BrickColor.new("Bright blue") then --Blue team
c[i].Character:moveTo(workspace.pos2.Position,workspace.pos2) --Position
elseif c[i].TeamColor==BrickColor.new("Bright red") then --Red team
c[i].Character:moveTo(lmao.LBA_Ball11.Handle.Position,lmao.LBA_Ball11.Handle) --Position
end
end
whatever.OOB1.Script.Disabled = true
whatever.BluePress.Transparency = 0.98
wait(3)
workspace.Game.scored.Value=false
sounds.Whistle:Play()
lmao.LBA_Ball11:clone().Parent = whatever
wait(4)
whatever.OOB1.Script.Disabled = false
whatever.timer.Disabled = false
whatever.STimer.Disabled = false
script.Disabled = false
wait(7)
whatever.BluePress.Transparency = 1
else
if whatever.time.Value ~= 1 then
script.Disabled = true
lol.player.Value = character.player.Value
wait()
sounds.victory or sounds.swish:Play()
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
15 Nov 2015 12:14 AM
add this at the end

local s = {sounds.victory, sounds.swish}
s[math.random(1,#s)]:Play()


#code R+ | local robux = "R$94,316"; local tix = "Tx98,606"
Report Abuse
CUBES4LIFE is not online. CUBES4LIFE
Joined: 22 Jun 2009
Total Posts: 4956
15 Nov 2015 12:21 AM
lol = script.Parent.Parent
brick = script.Parent
display = workspace.display
sounds = workspace.Sounds
whatever = game.Workspace
lmao = game.Lighting

those variables make me want to hurt someone

learn how to properly write variables, those won't cut it if you ever plan on actually writing good code
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
15 Nov 2015 12:24 AM
he can use "and" perfectly but can't use "or" lmao,
i'm going to point out the obvious that this guy can't script and this is a FM

"elseif character and character:findFirstChild("Handle") and whatever.shotclock.Value ~= 0 and whatever.time.Value ~= 0 and whatever.Music.Song2.IsPlaying == true and character.Name ~= "Guard" then"

ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs
Report Abuse
alphadeath is not online. alphadeath
Joined: 20 Dec 2009
Total Posts: 51059
15 Nov 2015 12:41 AM
Thanks abstract that worked
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
15 Nov 2015 09:39 AM
Welcome. If you have any more scripting problems then please just PM me.


#code R+ | local robux = "R$94,560"; local tix = "Tx98,620"
Report Abuse
Chocolatecaike is not online. Chocolatecaike
Joined: 23 Jul 2014
Total Posts: 801
15 Nov 2015 09:42 AM
".Or"
I died
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Let's Make a Deal
   
 
   
  • 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