Modulescripts are your answer if you want to make an animation player
if you make one you notice how its layout looks something like this
local Table = {}
return Table
Now the way modulescripts work is by requiring
in any script you can do require(modulescript) and this will return the Table shown in the example above.
Inside the body of the modulescript (behind the return) will run when the module was required first
Lets take this and make a function normal scripts can use now
function Table.CreateAnimationById(id)
--put your main function code now
--print statement because why not
return "Something"--returning a string, you might return the animation object instead
end
now lets check in a normal script
local Module = require(Modulescript)
print(Module.CreateAnimationById())
--This would print "Something" as designated by the function above
You can add multiple functions and properties to the module
function Table.FunctionExample()
Table.PropertyExample = "Property"
now since it returns the table and now theres a property lets plug it in to the script
print(Module.PropertyExample)
This would return Property because its what the property example value is
All ServerScriptService is is an internal service from which to run serverscripts (This means instead of running it in the workspace and it being replicated to everyone it just sits in SSS and runs)
ServerStorage however is the exact same thing but scripts inside it don’t run. This service was designed for holding things like maps or things that only the server needs access to.