I'm unsure of why the GetDescendants() isn't finding the folder.
Here is the script code:
local userInput = game:GetService("UserInputService")
--VARIABLES/REFERENCES:
local angleBasedCursor_RE = game.ReplicatedStorage:WaitForChild("giveAngleBasedCursor1")
local camBasedCursor_RE = game.ReplicatedStorage:WaitForChild("giveCamBasedCursor1")
local angleBasedCursor_S = game.ReplicatedStorage:WaitForChild("AngleBasedCursor1")
local camBasedCursor_S = game.ReplicatedStorage:WaitForChild("CamBasedCursor1")
local player = game.Players.LocalPlayer
local debounce = false
--FUNCTIONS:
camBasedCursor_RE.OnServerEvent:Connect(function(player)
print(player.Name .. " was given Cam-Based Cursor.")
if not debounce then
debounce = true
local newCursor = camBasedCursor_S:Clone()
newCursor.Parent = player.Character
newCursor.Name = "Cursor"
for i,v in (player.Character:GetDescendants()) do
if v:IsA("Folder") then
print("something")
v:Destroy()
end
end
wait(1)
debounce = false
end
end)
angleBasedCursor_RE.OnServerEvent:Connect(function(player)
print(player.Name .. " was given Angle-Based Cursor.")
if not debounce then
debounce = true
local newCursor = angleBasedCursor_S:Clone()
newCursor.Parent = player.Character
newCursor.Name = "Cursor"
for i,v in (player.Character:GetDescendants()) do
if v:IsA("Folder") then
print("somethin again")
v:Destroy()
end
end
wait(1)
debounce = false
end
end)```