Hey ya! I’m having a problem with a local function, in a server script running before the function is even called. The local function itself is sort of working. (I’ll explain later)
local vetBuildings = workspace.VetBuildings
local vet1 = vetBuildings.Vet1
local vet2 = vetBuildings.Vet2
local vet3 = vetBuildings.Vet3
local vet4 = vetBuildings.Vet4
local vet5 = vetBuildings.Vet5
local vet6 = vetBuildings.Vet6
local plotClaimSensor2 = vet2.ClaimPlot2
local debounce = false
local function onPartTouched_Vet2(otherPart)
if debounce == true then
else
debounce = true
local otherPart = otherPart.Parent -- The part/object that made that collison
local humanoid = otherPart:FindFirstChildWhichIsA("Humanoid")
if humanoid then
local player = humanoid.Parent
if player:FindFirstChild("BuildingTag") then
else
if vet2:GetAttribute("PlotOwner") == "" or vet2:GetAttribute("PlotOwner") == " " then
print("TESTS, 2nd")
vet2:SetAttribute("PlotOwner", player)
print("PASSED, 2nd ATTRIBUTE")
print(player)
plotClaimSensor2.Pole1.Transparency = 1
plotClaimSensor2.Pole2.Transparency = 1
plotClaimSensor2.Sensor.Transparency = 1
plotClaimSensor2.Pole1.CanCollide = false
plotClaimSensor2.Pole2.CanCollide = false
plotClaimSensor2.Sensor.CanCollide = false
plotClaimSensor2.Sensor.SurfaceGui.Enabled = false
local buildingTag = Instance.new("StringValue")
buildingTag.Name = "BuildingTag"
buildingTag.Parent = player
buildingTag.Value = "Vet2"
print("Instance.newSTRING")
debounce = false
end
end
end
end
end
plotClaimSensor2.Sensor.Touched:Connect(function()
print("Sensor been touched")
end)
The plotClaimSensor, is so far away. The prints, are being displayed into the output as soon as the game starts. I mean the model is being hidden using the transparent lines of code in the scripts above.