i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 07 Aug 2016 11:10 PM |
Whenever someone clicks the "Click to Play ID" button, the song changes for their own client but the previous song keeps looping for everyone else.. Why is that?
Here's the script (Don't mind the variables):
CLIENT SIDE:
--{Player Stuff} local Player = game.Players.LocalPlayer local PlayerGui = Player.PlayerGui --{Gui Stuff} local Board_Controls = PlayerGui:WaitForChild("BoardControls") local Mode_Frame = Board_Controls:WaitForChild("ModeFrame") local Song_Controls = Mode_Frame:WaitForChild("SongControls") local Custom_Song = Song_Controls:WaitForChild("CustomSong") local Control_Frame = Custom_Song:WaitForChild("ControlFrame") local Local_Script = Control_Frame:WaitForChild("LocalScript") --{SongName Stuff} local Change_Song = Song_Controls:WaitForChild("ChangeSong") local C_Frame = Change_Song:WaitForChild("ControlFrame") local S_Name = C_Frame:WaitForChild("SongName") --{Value} local Song_Value = Control_Frame:WaitForChild("CustomSongValue") --{Sound(s) + Sound.SoundId} local Lazerus = workspace:WaitForChild("Lazerus") local KMusic = workspace:WaitForChild("KMusic") --{Services} local ReplicatedStorage = game:GetService("ReplicatedStorage") local Run_Service = game:GetService("RunService") local MarketplaceService = game:GetService("MarketplaceService") local UserInputService = game:GetService("UserInputService") --{Event} local Custom_Song = ReplicatedStorage:WaitForChild("CustomSong") --{Debounce} local Debounce = false --{TextBox & TextButton} local CustomBox = Control_Frame:WaitForChild("Custom") local ChangeSong = CustomBox:WaitForChild("ChangeSong")
function CustomSong(Custom_S) if not Debounce then Debounce = true Song_Value.Value = CustomBox.Text for Down_Vol = 1,0,-0.1 do Lazerus.Volume = Down_Vol Run_Service.RenderStepped:wait() end Lazerus:Stop() Run_Service.RenderStepped:wait() local I_D = MarketplaceService:GetProductInfo(Song_Value.Value) Lazerus.SoundId = "http://www.roblox.com/asset/?id="..Song_Value.Value S_Name.Text = "[Current Song]: "..I_D.Name Lazerus:Play() for Up_Vol = 0,1,0.1 do Lazerus.Volume = Up_Vol Run_Service.RenderStepped:wait() end end Run_Service.RenderStepped:wait() Debounce = false end
ChangeSong.MouseButton1Down:connect(function(Custom_S) Custom_Song:FireServer(Custom_S) end)
Custom_Song.OnClientEvent:connect(function(Custom_S) CustomSong(Custom_S) end)
SERVER SIDE:
local CustomSong = game:GetService("ReplicatedStorage"):WaitForChild("CustomSong")
CustomSong.OnServerEvent:connect(function(Custom_S) CustomSong:FireAllClients(Custom_S) end)
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2016 11:11 PM |
variables r supposed to be short ok? ok.
i like ducks bro. deal wit it. |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 07 Aug 2016 11:12 PM |
lol I know but I like making long variables since it's good keyboard practice.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
gmatch
|
  |
| Joined: 21 May 2014 |
| Total Posts: 1173 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Aug 2016 11:16 PM |
'good keyboard practice'
who the hell taught you to code?
this is cancer
|
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 07 Aug 2016 11:19 PM |
I taught myself pretty much.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 07 Aug 2016 11:21 PM |
@gmatch
Don't I have to fireallclients from the server tho? Cuz there is no way that this can all be done by a localscript boi
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 07 Aug 2016 11:22 PM |
@Time
Also, honestly... If people would stop joking around and just help me I would've had this problem solved like 1-2 days ago.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 08 Aug 2016 12:15 AM |
dont pass objects thru fe
Custom_S will be nil on any client besides the one who has the object
u gotta do that stuff serverside and just pass id number |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 12:16 AM |
| descriptive variable names are always welcome. Better than half a dozen cframes labels CF + a number |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:17 AM |
@wow
Yeah well I have no idea what you're talking about and you should just fix it for me so I'm happy. I've been trying to fix this for a few days now so gimme a break pls.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:20 AM |
If you do fix it though, please give me comments and stuff so I can study that so I learn what I did wrong. That's the only way I've learned coding is through this forum and people fixing scripts for me. (I know it's a lot to ask for but honestly, I don't know what else to do at this point)
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 08 Aug 2016 12:21 AM |
change
function CustomSong(Custom_S) if not Debounce then Debounce = true Song_Value.Value = CustomBox.Text for Down_Vol = 1,0,-0.1 do Lazerus.Volume = Down_Vol Run_Service.RenderStepped:wait() end Lazerus:Stop() Run_Service.RenderStepped:wait() local I_D = MarketplaceService:GetProductInfo(Song_Value.Value) Lazerus.SoundId = "http://www.roblox.com/asset/?id="..Song_Value.Value S_Name.Text = "[Current Song]: "..I_D.Name Lazerus:Play() for Up_Vol = 0,1,0.1 do Lazerus.Volume = Up_Vol Run_Service.RenderStepped:wait() end end Run_Service.RenderStepped:wait() Debounce = false end
to occur on server not client, only pass ID Value im not going to do it because i hate your variables and im working on fixing a game rn where the origional creator did the same thing as you and its stupid |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:25 AM |
Ok well, most of these are pulling stuff out of the player and everytime I try to work with the player in a serverscript it never works out for me so... Just sayin.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 08 Aug 2016 12:27 AM |
| ya u gotta send the variables u need thru the remote event bro |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:29 AM |
Uh..? Confused asf right now.
So do I just put that in a serverscript then? What else do I do because i have no idea what you're talking about.. this is why I wish people would help me and stop telling me to replace stuff because it just confuses me.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 08 Aug 2016 12:30 AM |
"this is why I wish people would help me and stop telling me to replace stuff because it just confuses me."
lol dumbo
|
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:31 AM |
@Lae
No, i'm not dumb. I barely know FE so how should I know what he's talking about. I barely know FE for christ sakes.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 08 Aug 2016 12:34 AM |
| if you want someone to script for you, instead of wanting to learn how to script I would recommend paying them |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:35 AM |
No, I want to learn and I'd rather not pay because it's a waste of money in the end.
Because what do you learn from paying people for scripts? Absolutely nothing.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:39 AM |
Not to mention every tutorial on youtube that involves FE isn't good. At all. I watched all of them, went on wiki and, even the wiki doesn't explain it that good.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 08 Aug 2016 12:40 AM |
ok then look up on the wiki how to pass variables with a server event
and then do it and transfer the code above to fire with customsong event firing |
|
|
| Report Abuse |
|
|
i_Movie
|
  |
| Joined: 06 Apr 2014 |
| Total Posts: 11725 |
|
|
| 08 Aug 2016 12:44 AM |
Already mentioned, wiki is trash at explaining stuff with FE. Not using wiki, nor will I ever try to use the wiki with FE since even the examples there make no sense.
hi r u ok <-- See that right there? That's a stolen siggy! |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 08 Aug 2016 12:44 AM |
Personally, I think these variable names are fine. I'm not really in a position to do all the debugging, but I will say that one error I see is this:
CustomSong.OnServerEvent:connect(function(Custom_S) CustomSong:FireAllClients(Custom_S) end)
Custom_S will not be anything useful because the first argument to the OnServerEvent callback is the Player whose client triggered the event.
Per the wiki: http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent/OnServerEvent |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 08 Aug 2016 12:45 AM |
It's pretty good at explaining FE, you're just not willing to read the documentation.
|
|
|
| Report Abuse |
|
|