hello, im trying to make a script that gets every model in a folder and gets every value in said model and if its equal to something then something happens. but i cant seem to figure it out here is what i have so far.
game:GetService("ReplicatedStorage").RemoteEvents.CancelRegistration.OnServerEvent:Connect(function(plr)
plr.PlrStats.isRegistred.Value = false
local rings = workspace.Rings:GetChildren()
for i_,model in pairs(rings) do
if model:IsA("Model") then
end
end
end)
This should fix your problem, just replace the Something by the thing you search
game:GetService("ReplicatedStorage").RemoteEvents.CancelRegistration.OnServerEvent:Connect(function(plr)
plr.PlrStats.isRegistred.Value = false
local rings = workspace.Rings:GetChildren()
local Something = true
for i_, model in rings do
if model:IsA("Model") then
for i_, value:ValueBase in model:GetChildren() do
if not value:IsA("ValueBase") then continue end
if value.Value == Something then
--Something Found
else
--Something Not Found
end
end
end
end
end)
sorry, but it doesnt even print the thing i did. here is the modified code
game:GetService("ReplicatedStorage").RemoteEvents.CancelRegistration.OnServerEvent:Connect(function(plr)
plr.PlrStats.isRegistred.Value = false
local rings = workspace.Rings:GetChildren()
for i_, model in rings do
if model:IsA("Model") then
for i_, value:BoolValue in model:GetChildren() do
if not value:IsA("BoolValue") then continue end
if value.Value == plr.Name then
print("eh")
else
--Something Not Found
end
end
end
end
end)