I have a SurfaceGui that is deposited into the player's PlayerGui and adorned to a part in the Workspace.** When I test it in the Studio, the image changes just fine, but in a server, nothing happens! Since the gui is client-sided, shouldn't this work?** I'm pretty new to FilteringEnabled, so there may be much that I need to learn.
This is my script, which is in the SurfaceGui of the PlayerGui.
debounce = false script.Parent.MouseLeave:connect(function() if debounce == false then debounce = true script.Parent.Image = "http://www.roblox.com/asset/?id=615227711" end debounce = false end) script.Parent.MouseEnter:connect(function() if debounce == false then debounce = true script.Parent.Image = "http://www.roblox.com/asset/?id=615242781" end debounce = false end)
At the start of the game, this SurfaceGui is deposited into the Player's PlayerGui and then adorned to a part via this RemoteEvent in the Workspace.
script.SetAdornee.OnServerEvent:connect(function(player) local p = game.Players:WaitForChild(player.Name, 10) local findGui = p:WaitForChild("PlayerGui", 10) local giveGui = game.ServerStorage.Gui.TitleGui:Clone() giveGui.Parent = findGui giveGui.Adornee = game.Workspace.StartMenuArea.Classroom.Board end)
This LocalScript in the StarterPack fires the RemoteEvent at the start of the game.
player = game.Players.LocalPlayer game.Workspace.RemoteEvents.SetAdornee:FireServer(player)
Any and all help is most certainly appreciated!
ServerScripts can't see a players PlayerGui. GUI's should be completely handled from the client. Set the adornee to the desired part from the client, no need for events to the server.
(If I'm correct you should get an error in your server log while playing in online mode. (Hit f9 to open the console!))