I have a sctipt that should change the parent and position of a mesh when t is pressed. But for some reason it doesnt work.
useri.InputBegan:Connect(function(input)
print("Input made")
if input.KeyCode == Enum.KeyCode.T then
print("Input correct")
for i, v in pairs(workspace.LadderStuff:GetDescendants()) do
print("Checking")
if v.ClassName == "MeshPart" and v.Parent == workspace.LadderStuff.Stages or v.Parent == workspace.LadderStuff.Active then
v.Parent = workspace.LadderStuff.Stages
v.CFrame = workspace.LadderStuff.MainPart.CFrame
end
end
end
end)
Notes:
-Nothing prints
-This is a piece of a larger script with another 2 imput began events which work.
If there are other InputBegan events, that is probably your issue. Combine them all into one InputBegan.
InputBegan:Connec(function(input)
if input.KeyCode == Enum.KeyCode.T then
elseif input.KeyCode == Enum.KeyCode.E then
elseif input.KeyCode == Enum.KeyCode.Q then
end
end)
Function arguments are always optional, if he doesn’t need it then he doesn’t need to include it.