I can't seem to figure out how to the 'check' function, the script was functional up until I got to making the check.
I am rusty so please forgive me if it is a simple issue, I haven't attempted deving for a good year.
script.Parent.Touched:connect(function(hit)
if hit.Parent then
local hum = hit.Parent:FindFirstChild("Humanoid")
if not hum then
print('Wasnt a humanoid')
else
local egg_plot = game.ServerStorage.Egg_Plot:Clone()
egg_plot.Parent = game.Workspace
function check()
local already_in_workspace = game.Workspace.Egg_Plot
if already_in_workspace.Parent == game.Workspace then
egg_plot:Destroy()
else
print('there wasnt an Egg Plot in workspace')
end
end
check()
end
end
end)

1 comment
It didn't work but I didnt notice I had ran the function outside of the if statement, thanks!