-
What is the issue? i tried to disable a clickdetector locally but there is an error
-
What solutions have you tried so far? changing the parent of the clickdetector to nil
local egg = game.ReplicatedStorage:WaitForChild("Assets"):WaitForChild("Egg")
local click = game.Workspace.Egg:WaitForChild("Part"):WaitForChild("ClickDetector")
local camera = Instance.new("Camera")
camera.CFrame = CFrame.new(egg.Position + (egg.CFrame.LookVector * 5),egg.Position)
local eggviewport = script.Parent.Main:WaitForChild("ViewportFrame")
eggviewport.CurrentCamera = camera
egg.Parent = eggviewport
game.ReplicatedStorage.HatchEgg.OnClientEvent:Connect(function(pet)
eggviewport.Visible = true
click.MaxActivationDistance = 0
wait(1)
click.MaxActivationDistance = 32
eggviewport.Visible = false
end)