Ok, so basically I clone a folder into the players character. But when I trigger a proximity prompt, the script errors. It basically says that the folder does not exist in my character, but it does. I clone the folder by a GUI when clicked, which seems to work.
local whispers = script.Parent.Parent.whispers
local explosion = script.Parent.Parent.explosion
local commonchiiken = script.Parent.Parent.Parent.CommonChiiken
local fard = script.Parent.Parent.fard
local pointlight = script.Parent.Parent.Parent.Black.PointLight
script.Parent.Triggered:Connect(function(player)
print("activated")
local char = player.Character
local ticket = char.CommonTicket -- where it errors
local pets = player:WaitForChild("Pets")
local leaderstats = player:WaitForChild("leaderstats")
local chiikens = leaderstats:WaitForChild("Chiikens")
local ccvalue = pets:WaitForChild("CommonChiiken")
if ticket.ClassName == "Folder" then -- does not fire
print("true")
script.Parent.Enabled = false
for count = 0.5,10,0.1 do
whispers.Volume = count
wait(0.1)
end
explosion:Play()
repeat
game.Workspace.Shake.Value += 1
wait(0.1)
until
game.Workspace.Shake.Value == 2
whispers:Stop()
wait(2)
fard:Play()
commonchiiken.Anchored = false
chiikens.Value -= 0
ccvalue.Value = true
wait(35)
commonchiiken.Anchored = true
commonchiiken.Position = Vector3.new(125.906, 29.54, 294.668)
whispers:Play()
whispers.Volume = 0.5
script.Parent.Enabled = true
else
local a = 0
print("false")
explosion:Play()
repeat
a += 1
pointlight.Enabled = true
wait(1)
pointlight.Enabled = false
wait(1)
until
a == 5
a = 0
end
end)