I have an on on touch function in a script located in serverscriptservice and I would like to enable a gui in it. I can't figure out how to do this since I only have experience showing guis with local scripts.
Here was my original code which did not work
local gui = hit.Parent.PlayerGui:FindFirstChild("Gui") if gui then gui.Enabled = true end
How would I navigate to the playergui through the ontouch? I have also thought of cloning the gui into the playergui, but I am not sure how I would do that and if that would even work.
Any help or advice is appreciated, thank you
Hit.Parent is the character of the player, not the player instance.
try this instead:
local plr = game.Players:GetPlayerFromCharacter(hit.Parent) local gui = plr.PlayerGui.Gui if gui and plr then gui.Enabled = true end
Note: this script was not tested