Hello, I am making a game where if you guess the correct answer, steps spawn below you. However, it is not spawning any parts no matter how hard I try. Can someone help? Here is my current code:
local answers = {
"dog",
"cat",
"mockingjay",
"goldfish",
"george washington",
"barack obama",
"abraham lincoln"
}
local Status = game.ReplicatedStorage.Status
local plrs = {}
game.ReplicatedStorage.SendAnswer.OnServerEvent:Connect(function(player,answer)
local StepsFolder = workspace.StepsFolder
if answer == table.find(answers,answer) then
local length = #answer
string.lower(answer)
for i = 1,length do
local step = Instance.new("Part")
step.Parent = StepsFolder
step.Color = Color3.new(0.901961, 1, 0.576471)
step.Name = "testingStep"
step.Size = Vector3.new(5,1,5)
step.CFrame = player.Character:FindFirstChild("HumanoidRootPart").CFrame - Vector3.new(0,1,0)
print(step.Parent)
end
end
end)
Extra details:
This is a server script inside of another script which is inside ServerScriptService.
Thanks!
Have a wonderful rest of your day! -Earthraphobic2
Hi. You will need to ensure that you are setting a Position, otherwise it will default to 0,0,0 and also make sure the part is Anchored and/or CanCollide is on, otherwise it will fall out of the environment.
Hi, thanks for getting back to me. I have anchored the part, and changed CFrame to Vector3/Position, however it is still not spawning in? Heres a picture of “Explorer” when its supposed to spawn in: