I’m doing a check in the script to see if it can be done so that if the condition is not suitable, the output does not output it to me as an error?
Here is my script
script.Parent.Touched:connect(function(Hit)
print(Hit.Parent.Name)
if Hit.Parent.W3.Value then
game.ServerScriptService.MainScript.Arriv.W3inCaf.Value = true
print("W3 == true")
end
end)
I think tou’re trying to check whether or not Hit.Parent.W3 exists. You just have to put it into a FindFirstChild method to check for existance. So it’d look like this:
local object = Hit.Parent:FindFirstChild("W3")
if object and object.Value then
...
end
Just replace your if condition there with this and leave everything inside of it the same
local noideawhatthisisfor = game.ServerScriptService.MainScript.Arriv.W3inCaf
script.Parent.Touched:connect(function(Hit)
local parent = Hit.Parent;
print(parent);
if parent:FindFirstChild("W3") and parent.W3.Value then
noideawhatthisisfor.Value = true
print("W3 == true", parent.W3)
end
end)