Accessing an module script to manipulate GUI from a server script

pretty straight forward,

server script (in workspace):

local ScreenModule = require(game.ServerScriptService:WaitForChild("screen screen mover"))

local PP = script.Parent.ProximityPrompt

PP.Triggered:Connect(function(player)
	ScreenModule.moveScreen()
end)

Module script (in ServerScriptService):

local module = {}

local SG = game:GetService("StarterGui")

local mainF1 = SG.dono.Frame1
local mainF2 = SG.dono.Frame2

function module.moveScreen()
	game:GetService("TweenService"):Create(mainF1, TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut, 0, false, 0), {Position = UDim2.new(0.214, 0,0.185, 0)}):Play()
	game:GetService("TweenService"):Create(mainF2, TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut, 0, false, 0), {Position = UDim2.new(0.204, 0,0.171, 0)}):Play()
end 

return module

thanks fr

I’m not sure I fully understand what you’re trying to do here.

By design, GUIs are meant to be manipulated client-side, not from the server.

If you need to communicate between client and server, you can use remotes to do that more efficiently.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.