So... I may be thinking this a little bit too hard.
local f = script.Parent.Spawner.Value workspace.f.Part:Destroy()
The part isn't getting destroyed.
You don't need workspace, only f
. f
is a reference to the object already.
f.Part:Destroy() -- This doesn't look right if it's an actual value, but I can't see your Workspace so I will assume it is correct.
Variable Link: http://robloxdev.com/articles/Variables
Examples:
local variableA = game.Workspace.Part
local variableB = 5
local variableC = "String"
local variableD = CFrame.new()
local variableE = Color3.new()
Ect...
If you're gonna index the value of variable 'f', use square parenthesis:
workspace[f].Part:Destroy()
First, it would be
game.Workspace.f.Part:Destroy()
Second, what you have here is implying that inside the scripts parent there is a spawner with a value inside of it, and inside the value is a part.
Try this for the overall
local f = script.Parent -- assuming the parent of the script is what you want destroyed wait(0) game.Workspace.f:Destroy()