So this script is in a local script inside of a tool, and I keep getting this error: 16:17:46.660 - Players.Player1.Backpack.MagicCircle Test.LocalScript:20: attempt to index upvalue 'pc' (a nil value)
I don't get what the error is for/caused by? And I also don't know how to fix it.
local player = game.Players.LocalPlayer
local pc = player.Character
local d = false
script.Parent.Activated:connect(function()
if d ~= true and game.Workspace:FindFirstChild("CircleBlock") == nil then
d = true
local cb = Instance.new("Part")
cb.Name = "CircleBlock"
cb.Size = Vector3.new(0, .25, 0)
cb.Anchored = true
cb.CanCollide = false
cb.Transparency = 1
cb.Parent = workspace
cb.CFrame = pc.Torso.CFrame * CFrame.new(0, -2.8, 0)
local cr = game.ReplicatedStorage.MyScripts.RotationScript:Clone()
cr.Parent = cb
local cs = Instance.new("Decal")
cs.Face = "Top"
--cs.Texture = "http://www.roblox.com/asset/?id=412956943"
cs.Texture = "http://www.roblox.com/asset/?id=268043891"
cs.Parent = cb
local cs2 = Instance.new("Decal")
cs2.Face = "Bottom"
--cs.Texture = "http://www.roblox.com/asset/?id=412956943"
cs2.Texture = "http://www.roblox.com/asset/?id=268043891"
cs2.Parent = cb
for i = 1, 50 do
cb.Size = cb.Size + Vector3.new(2, 0, 2)
wait()
end
wait(3)
for i = 1, 10 do
cb.CFrame = cb.CFrame * CFrame.new(0, i/8, 0)
wait(.15)
end
wait(.5)
cb:Destroy()
cs:Destroy()
cs2:Destroy()
end
d = false
end)
