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
 

Re: On chat, spotlight on and off

Previous Thread :: Next Thread 
Hppolice is not online. Hppolice
Joined: 06 Feb 2012
Total Posts: 578
15 Sep 2013 10:48 AM
Hi,

For a training place, I'm making a spotlight script, where when the training starts, a trainer could say, :on sp1 (Spotlight 1), and the dynamic lighting Spotlight would be enabled. (it stays disabled)

I started doing a script, it didn't work out. Any help would be well appreciated!

Also, I would like only HR's to be able to say this, and I forgot how to make that admin script. I kinda feel lazy to look it up right now... lol

Script:
--------------------------------------------------------------------------

function onChatted(msg, speaker)

source = string.lower(speaker.Name)
msg = string.lower(msg)

if msg == ":on sp1" then
script.Parent.StringValue.Value = "Disabled"
script.Parent.StringValue.Value = "Enabled"
script.Parent.Parent.Part1.SpotLight.Enabled = true
script.Parent.Parent.Part2.SpotLight.Enabled = true
script.Parent.Parent.Part3.SpotLight.Enabled = true
script.Parent.Parent.Part4.SpotLight.Enabled = true
else if
script.Parent.StringValue.Value = "Enabled"
script.Parent.StringValue.Value = "Disabled"
script.Parent.Parent.Part1.SpotLight.Enabled = false
script.Parent.Parent.Part2.SpotLight.Enabled = false
script.Parent.Parent.Part3.SpotLight.Enabled = false
script.Parent.Parent.Part4.SpotLight.Enabled = false
end

if msg == ":on sp2" then
script.Parent.Parent.Spotlight2.Light.enabled.Spotlight = true
end
if msg == ":on sp3" then
script.Parent.Parent.Spotlight3.Light.enabled.Spotlight = true
end
if msg == ":on linesp1" then
script.Parent.Parent.LineSpotlight1.Light.enabled.Spotlight = true
end
if msg == ":on linesp2" then
script.Parent.Parent.LineSpotlight2.Light.enabled.Spotlight = true
end


end

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

game.Players.ChildAdded:connect(onPlayerEntered)

------------------------------------------------------------------------------------

Thanks for you help!

Hppolice
UCR- HRiT
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
15 Sep 2013 10:50 AM
light.enabled.SpotLight?

What?
Report Abuse
Hppolice is not online. Hppolice
Joined: 06 Feb 2012
Total Posts: 578
15 Sep 2013 10:51 AM
Light is the name of the part
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
15 Sep 2013 10:51 AM
Highly doubt you know how to script. What you requested is easier then the script you posted.
Report Abuse
Hppolice is not online. Hppolice
Joined: 06 Feb 2012
Total Posts: 578
15 Sep 2013 10:51 AM
#isuckatscripting

bumpeh
Report Abuse
Hppolice is not online. Hppolice
Joined: 06 Feb 2012
Total Posts: 578
15 Sep 2013 10:52 AM
Yeah, I'm not too good, meh brain thinks one thing, i bet it could be easier...
Report Abuse
Hppolice is not online. Hppolice
Joined: 06 Feb 2012
Total Posts: 578
15 Sep 2013 10:53 AM
Willing to pay 20 robux for someone to help
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
15 Sep 2013 10:57 AM
FIrst you:
http://wiki.roblox.com/index.php/User:Quenty/How_To_Receive_Help_From_Scripters

Then you:
Repost

Then we:
Help.

If it's properly posted.
Report Abuse
Hppolice is not online. Hppolice
Joined: 06 Feb 2012
Total Posts: 578
15 Sep 2013 10:58 AM
^ he posts that to everyone .-.
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
15 Sep 2013 11:00 AM
@Hppolice

People need to learn how to ask for help. If you don't do it how the wiki says then helpers won't be able to help.

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