I can script but i for sure am not this good at it.. and my friend gave me this script but I think he copied it but he said he made it but anyway how do you make it to where it reloads from clicking instead of hitting R..
function onButton1Up(mouse) automatichold = false end function onKeyDown(key, mouse) if key:lower() == "r" then if script.Parent.Ammo.Value ~= script.Parent.MaxAmmo.Value then reloadsound = script.Parent.Handle:FindFirstChild("Reload") if reloadsound then reloadsound:Play() end enabled = false script.Parent.VisibleB.Value = true script.Parent.StringValue.Value = "Reloading" repeat script.Parent.StringValue.Value = "Reloading" wait(0.3) script.Parent.Ammo.Value = script.Parent.Ammo.Value + 3 script.Parent.StringValue.Value = "Reloading" until script.Parent.Ammo.Value >= script.Parent.MaxAmmo.Value script.Parent.Ammo.Value = script.Parent.MaxAmmo.Value wait(0.2) script.Parent.VisibleB.Value = false enabled = true end end if key:lower() == "m" then if GunType == 0 then GunType = 0 Recoil = 3 else GunType = 1 Recoil = 3 end end end function onEquipped(mouse) equipped = true if mouse == nil then print("Mouse not found") return end mouse.Icon = "http://www.roblox.com/asset/?id=52812029" mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.Button1Up:connect(function() onButton1Up(mouse) end) mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end) end function onUnequipped(mouse) equipped = false automatichold = false end script.Parent.Equipped:connect(onEquipped) script.Parent.Unequipped:connect(onUnequipped) while true do wait() if script.Parent.Ammo.Value == 0 then script.Parent.VisibleB.Value = true script.Parent.StringValue.Value = "Reload" end if GunType == 1 then script.Parent.ModeText.Value = "Auto" else script.Parent.ModeText.Value = "Semi" end end
Assuming you are using the :GetMouse()
you can use the event .Button1Down()
. This fires when the player clicks down Left Mouse Button. Similarly with .Button2Down()
when the player clicks down Right Mouse Button.