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

contextActionService with Reload keybuttons?

Asked by 6 years ago
Edited 6 years ago

I think my script is wrong,

local contextActionService = game:GetService("ContextActionService")
contextActionService.LocalToolEquipped:Connect(function(Tool)
    local player = game:GetService("Players").LocalPlayer
        local char = player.Character or player.CharacterAdded:Wait()
        local tool = char:FindFirstChildOfClass("Tool")
        if tool then
            local bindables = tool:FindFirstChild("Bindables")
            if bindables then

                local bind = bindables:FindFirstChild("Reload")
                if bind then
                    bind:Fire()
                end
            end
            end

end)
ContextAction.LocalToolUnequipped:Connect(function(Tool)
    if Tool:FindFirstChild("Reload") then
        ContextAction:UnbindAction("Reload")
contextActionService:SetPosition("DeleteBaseplateButton",UDim2.new(0.10,-15,0.1,-1))
contextActionService:SetImage("DeleteBaseplateButton","http://www.roblox.com/asset/?id=1398003510")
0
How would we know? you have not explained the question at all. User#5423 17 — 6y

Answer this question