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: Script Help - Area Triggered Music

Previous Thread :: Next Thread 
HeidiNZv2 is not online. HeidiNZv2
Joined: 01 Oct 2014
Total Posts: 48
06 Oct 2016 04:08 AM
is there any particular way I would be able to make it so that when I enter an area, a different audio starts, and when I exit that area into another one, another music plays? This would be really helpful for my RPG if it were possible. I'm a 567% newbie to scripting and if you tried to explain to me how to do something I probably wouldn't understand, so if you could post a code and what to do with it, I would greatly appreciate it

If this isn't possible thank you for reading and possibly trying to help.
Report Abuse
taxijack is not online. taxijack
Joined: 21 Nov 2013
Total Posts: 469
06 Oct 2016 04:27 AM
Yes it is possible let me just get the script code
Report Abuse
taxijack is not online. taxijack
Joined: 21 Nov 2013
Total Posts: 469
06 Oct 2016 04:30 AM


local brick = script.Parent
local sound = script.Parent.Sound

brick.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
play = sound:Clone()
play.Parent = player.PlayerGui
play:Play()
end
end)
Report Abuse
taxijack is not online. taxijack
Joined: 21 Nov 2013
Total Posts: 469
06 Oct 2016 04:32 AM
Make a part and rename it brick and then move the script and the music into the part make sure the music is called sound
Report Abuse
Aliics is not online. Aliics
Joined: 29 Sep 2014
Total Posts: 471
06 Oct 2016 06:55 AM
That's... fairly inefficient. It would be better to use magnitude to check if the player is in an area. local player = game.Players.LocalPlayer local char = player.Character local area = game.Workspace['area'] if (char.Torso.Position - area.Position).magnitude < 200 then --if you're 200 studs from ###### ###### for sound end
Report Abuse
kakaghiti is not online. kakaghiti
Joined: 31 Oct 2010
Total Posts: 39
06 Oct 2016 09:55 AM
Could you put this in script terms? I mean in rows rather than one big sentence. Thanks.
Report Abuse
XMegaInfernapeX is not online. XMegaInfernapeX
Joined: 20 Feb 2011
Total Posts: 488
06 Oct 2016 09:58 AM
region3
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