Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why am I not able to access guis inside the PlayerGui via a serverscript?

Asked by 5 years ago

I'm trying to access a gui inside of PlayerGui via a server script, however I am not able to do so. I created a remote event in an attempt to clone a localscript from replicatedstorage to a gui inside of PlayerGui. This would be easy to do, but I cannot for some reason access MenuGui[A Gui inside PlayerGui] from the server script. (press view source if you are unable to see the full script Error is in line 14)

--local script
game.ReplicatedStorage.RemoteEvents.ChangeMoveset:FireServer("EMset","E",3,script.Parent.E_Mset.Value)
--ServerScript
ChangeMoveSetEvent.OnServerEvent:Connect((function(Player,key,move,wtd,MST)

    if wtd == 1 then 


    elseif wtd == 3 then 


        MST = Player.leaderstats[key].Value
        local cln = game.ReplicatedStorage.MoveSetFolder[Player.leaderstats[key].Value]
        local Clone_Script = Player.leaderstats[key].Value.."Script"
        local sc = cln[Clone_Script]:Clone()
        sc.Parent = Player.PlayerGui.MenuGui.CombatGui[move] --This is the Error


    end

end))

Answer this question