Why won't this work?

I am placing a LocalScript under a Frame so it saves its visibility state when a player leaves and rejoins. I also have a Script in ServerScriptService. If anyone knows a solution please let me know!

LocalScript:
Screenshot 2024-06-08 160422

ServerScriptService Script:

Attributes don’t sync from client to server, you’d have to use a RemoteEvent

3 Likes

I did the following for both the Server Script and LocalScript. Currently, it saves for one frame, but if I wanted to paste the LocalScript under many Frames and have all of them save, what should I change? Thanks for the help, I appreciate it!
Local:


Server:

I would make it into a module and then require(module)

That way, if you want to edit the code you only need to edit it once

You’d need to remove frame = script.Parent and have a method that binds the frame

local module = require(PATH_TO_MODULE)

module:BindFrame(script.Parent)
local module = {}

local frame = nil

module:BindFrame = function(newFrame)
    frame = newFrame
end

return module

You might want to also add some checking if frame is nil

1 Like

I have been at this for a long time and quite frankly, I am not a good coder. Would you be cool with going in there for me for 3k and fix it for me? If not, I totally understand, just figured I’d make you an offer because I am sick of this not working haha

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