Right now I’m unsure if it’s safe to use said service to quickly get an item without doing script.Parent.Parent.Parent... or workspace:FindFirstChild().
I’m about to work on a framework for a game I’m working on, and I want its contents accessible without a strict path (even if I moved them somewhere that a LocalScript can see, I don’t need to change paths in code). I’ve been eyeing on CollectionService’s GetTagged so I can get the first item.
I have one theory, though, that may make me want to avoid this method: It’s probably possible to hijack the first item “GetTagged” returns, at least on the client’s side.
Is this method safe? If not, are there any other ways to achieve this? Thanks.
I mean yeah, but even if changes are not visible to the server, would it be possible to still confuse LocalScripts?
If a LocalScript were to be run at a later time, and for reasons probably caused by an exploiter, they gave an object a tag whose name is exactly the same as my framework’s tag, that will still cause problems, no?
Use ObjectValues, and put them all under a folder under ReplicatedStorage, you can loop through them all if you really want to else give it an AttributeValue as well to specify them, change their name, have another folder inside the original folder etc.
for _, objValue in pairs(game:GetService("ReplicatedStorage"):WaitForChild("Tagged"):GetChildren()) do
local obj = objValue:IsA("ObjectValue") and objValue.Value
if obj then
-- is tagged
end
end
It copies over from Server to Client. CollectionService does not in fact.
else use RemoteFunctions, request the tagged data and return it to the client.
An exploiter can change scripts as well, everything can be exploited on the client. You cannot stop this from happening even with CollectionService, there are ways around it. There is no real way to stop exploiters from changing the script, changing the data received etc. So stop worrying about that.
I’ll probably have to shelf my idea of using CollectionService for now, might as well stick to remotes and strict paths instead. I’ll just use CollectionService for less important game aspects. Thanks @xZylter and @KJry_s.