ah, i’m useless. Although I try to find the solution in various ways, 3 worked in only one GetDescendants, the others. How can I put 2 GetDescendants on the same Line?
local text = script.Parent.MenuKeyPrimero
local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.Players.LocalPlayer.KeysData.InteractiveKey:GetPropertyChangedSignal("Value"):Connect(function()
game.Players.LocalPlayer.KeysData.InteractiveKey.Value = text.Text
end)
local Interactive = game.Players.LocalPlayer:WaitForChild("KeysData"):WaitForChild("InteractiveKey")
Interactive.Changed:Connect(function(val)
if #val == 0 then return end
local key = Enum.KeyCode[val]
if not key then return end
for _, item in ipairs(workspace:GetDescendants(), ReplicatedStorage:GetDescendants()) do
if item:IsA("ProximityPrompt") then
item.KeyboardKeyCode = key
end
end
end)