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: Question.

Previous Thread :: Next Thread 
Craftwithcookie is not online. Craftwithcookie
Joined: 21 Dec 2012
Total Posts: 951
09 Sep 2016 08:55 PM
script.Parent.Touched:connect(function(hit)
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player ~= nil then
Player.PlayerGui.Coin:Play()
Player.PlayerGui.ScreenGui.CoinCounter.Coins.Value = Player.PlayerGui.ScreenGui.CoinCounter.Coins.Value + 1
script.Parent:Destroy()
end
end)

while true do
wait()
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.075, 0)
end

Recently, dumb me just realized that you need a localscript to play a sound locally, not just have the sound be in the GUI. I realized that because I played my game in the Roblox Player, and the sound did not work. It did, however, work in Roblox studio. I could convert this to a LocalScript, but then would the coin dissapear on the other players side? BTW I scripted this myself, not free model.
Report Abuse
NukeLuckyLuke is not online. NukeLuckyLuke
Joined: 08 Apr 2016
Total Posts: 5767
09 Sep 2016 08:57 PM
wdym?
Report Abuse
Craftwithcookie is not online. Craftwithcookie
Joined: 21 Dec 2012
Total Posts: 951
09 Sep 2016 09:04 PM
What do I mean?

I want the sound to locally play when I collect the coin, and that requires a LocalScript, and have the coin destroy when collected, and that requires a server script!
Report Abuse
Craftwithcookie is not online. Craftwithcookie
Joined: 21 Dec 2012
Total Posts: 951
09 Sep 2016 09:07 PM
bump
maybe this bump is too early
Report Abuse
NukeLuckyLuke is not online. NukeLuckyLuke
Joined: 08 Apr 2016
Total Posts: 5767
09 Sep 2016 09:14 PM
oh. sorry have not learned this stuff yet.
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
09 Sep 2016 09:17 PM
serverscript detects when the coin is hit. deletes it and fires a remoteevent to that player's client. client receives remoteevent and plays sound locally.


Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
09 Sep 2016 09:22 PM
Clone and place a local script that just plays the coin sound into the player's PlayerScripts instance.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
09 Sep 2016 09:23 PM
Kodran's method is the best way to do it, I just assumed you don't have filtering enabled.
Report Abuse
Craftwithcookie is not online. Craftwithcookie
Joined: 21 Dec 2012
Total Posts: 951
09 Sep 2016 09:33 PM
Is there a way without a remote function? I tried, but I still don't quite understand the remote function well enough to do it.
Report Abuse
Craftwithcookie is not online. Craftwithcookie
Joined: 21 Dec 2012
Total Posts: 951
09 Sep 2016 09:44 PM
bump
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
09 Sep 2016 09:52 PM
09-09-2016 07:22 PM
"Clone and place a local script that just plays the coin sound into the player's PlayerScripts instance."
Report Abuse
Craftwithcookie is not online. Craftwithcookie
Joined: 21 Dec 2012
Total Posts: 951
09 Sep 2016 09:55 PM
Oh, should of understood that better. Thanks!
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