Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone fix me this code? fire all touch interests(contact me Someone#9827)

Asked by 4 years ago
for i,v in next, workspace:GetDescendants() do
    if v:IsA'TouchTransmitter' then
        table.insert(Tab,v)
    end
end
local plr=game:GetService'Players'.LocalPlayer
spawn(function()
    local UIS=game:GetService'UserInputService'
    UIS.InputBegan:Connect(function(Key)
        if Key.KeyCode==Enum.KeyCode.H and not UIS:GetFocusedTextBox() then
            for i,v in next,Tab do
                if v:IsA'TouchTransmitter' then
                    print'Fired!'
                    if firetouchinterest then
                        firetouchinterest(plr.Character.HumanoidRootPart,v.Parent,0)
                        wait()
                        firetouchinterest(plr.Character.HumanoidRootPart,v.Parent,1)
                    end
                end
            end
        end
    end)
end)

it says : bad argument #1 to 'insert'(table expected, got nil). Now it does nothing

0
Scripting Helpers is not a request site! Your post will be removed if it does not comply with our rules. Please see this help article for more information. Sonnenroboter 336 — 4y
0
Also reposting isn't allowed. If your'e lucky your account will get deleted. Sonnenroboter 336 — 4y
0
@Sonnenroboter Reposting is not against the guidelines. Maybe reading the guidelines FIRST before complaining. hasanchik 49 — 4y

Answer this question