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
 

bah

Previous Thread :: Next Thread 
UnknownGunner is not online. UnknownGunner
Joined: 28 Apr 2011
Total Posts: 2881
06 Apr 2012 09:08 PM
I think the problem here is that my script keeps checking the whole script before that part is activated. If I said !start battleteam, it's reading the elseif part as well and not working when I say !end battleteam. Help? D:

started = false

function checkToLetIn(name)
for i = 1,#_G.admins do
if (string.upper(name) == string.upper(_G.admins[i])) then return true end
end
return false
end

function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
if (checkToLetIn(source)) then
if msg == "!start battleteam" and started == false then
script.Parent.Transparency = 0.1
wait(0.1)
script.Parent.Transparency = 0.2
wait(0.1)
script.Parent.Transparency = 0.3
wait(0.1)
script.Parent.Transparency = 0.4
wait(0.1)
script.Parent.Transparency = 0.5
wait(0.1)
script.Parent.Transparency = 0.6
wait(0.1)
script.Parent.Transparency = 0.7
wait(0.1)
script.Parent.Transparency = 0.8
wait(0.1)
script.Parent.Transparency = 0.9
wait(0.1)
script.Parent.Parent = game.Lighting
started = true
elseif msg == "!end battleteam" and started == true then
script.Parent.Parent = game.Workspace
newDoor.Transparency = 0.9
wait(0.1)
newDoor.Transparency = 0.8
wait(0.1)
newDoor.Transparency = 0.7
wait(0.1)
newDoor.Transparency = 0.6
wait(0.1)
newDoor.Transparency = 0.5
wait(0.1)
newDoor.Transparency = 0.4
wait(0.1)
newDoor.Transparency = 0.3
wait(0.1)
newDoor.Transparency = 0.2
wait(0.1)
newDoor.Transparency = 0.1
wait(0.1)
newDoor.Transparency = 0
started = false
end
end
end

function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end

game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
UnknownGunner is not online. UnknownGunner
Joined: 28 Apr 2011
Total Posts: 2881
06 Apr 2012 10:09 PM
Helppp!
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
06 Apr 2012 10:57 PM
That warning won't bother you. But moving your script to Lighting will stop it from running anymore.
Report Abuse
UnknownGunner is not online. UnknownGunner
Joined: 28 Apr 2011
Total Posts: 2881
07 Apr 2012 02:19 AM
Thankyee lots. :)
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
07 Apr 2012 03:52 AM
Use for loops btw ;)
Report Abuse
UnknownGunner is not online. UnknownGunner
Joined: 28 Apr 2011
Total Posts: 2881
07 Apr 2012 04:45 AM
I was gonna, then I just noticed once I was done, so it doesn't matter. :P

for i = 1, 9
game.Workspace.fieldForceField.Transparency = game.Workspace.fieldForceField.Transparency - 0.1
wait(0.1)
end
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