PipeSader
(PipeSader)
#1
I am trying to get the value of my attributes that I have placed in a part in serverstorage, what am I doing wrong?

In my local script:
-- Getting attributes
local minZoomAttributeFPS = game.ServerStorage.zoomAttributes:GetAttribute("minZoom")
local maxZoomAttributeFPS = game.ServerStorage.zoomAttributes:GetAttribute("maxZoom")

And from my function I want to place its values
in my function:
limitCameraUpDown(minZoomAttributeFPS, maxZoomAttributeFPS)
KIDamado80
(KIDamado80)
#2
limitCameraUpDown:SetAttribute(minZoomAttributeFPS, maxZoomAttributeFPS)
1 Like
PipeSader
(PipeSader)
#3
That’s a function, should I do it that way?
KIDamado80
(KIDamado80)
#4
oh hold up my bad don’t forget to add a :WaitForChild()
local minZoomAttributeFPS = game.ServerStorage:WaitForChild(“zoomAttributes”):GetAttribute(“minZoom”)
local maxZoomAttributeFPS = game.ServerStorage:WaitForChild(“zoomAttributes”):GetAttribute(“maxZoom”)
either that or you can’t access it from ServerStorage
oSudden
(Sam)
#5
The reason why is because your script is on the client.
Instances in the Server Storage folders (ServerScriptService, ServerStorage) cannot be accessed by the client.
Move your parts to ReplicatedStorage and then change the code to this
-- Getting attributes
local minZoomAttributeFPS = game.ReplicatedStorage.zoomAttributes:GetAttribute("minZoom")
local maxZoomAttributeFPS = game.ReplicatedStorage.zoomAttributes:GetAttribute("maxZoom")
1 Like
PipeSader
(PipeSader)
#6
Thanks a lot! it works perfect for me 