I am trying to make an objective system for my game, but I don’t wanna deal with this hardcoded mess. So how do I turn this simple objective system into softcode? I wouldn’t care if it was complex or barely unreadable. Heck, you can even write the code in the enchantment table language for all I could care. I just don’t want this hardcoded piece of digital spaghetti.
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
for i, v in CollectionService:GetTagged("Objective") do
v.Triggered:Connect(function()
v.Parent.Parent:Destroy()
ReplicatedStorage.Bindables.BindableEvent:Fire(v.Name)
end)
end
ReplicatedStorage.Bindables.BindableEvent.Event:Connect(function(name)
if name == "LogoPrompt" then
part:SetAttribute("RSLogoFound", true)
elseif name == "BandPrompt" then
part:SetAttribute("BandFound", true)
elseif name == "NotePrompt" then
part:SetAttribute("NoteFound", true)
end
end)
Any help would work, thanks!