How can I tell the script that when the player presses the button, it is to shoot?
local cas = game:GetService("ContextActionService")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local function buttonPressFunction()
MouseButton1Click:Connect(function()
end)
char:UnbindAction("ExtraFireButton")
end
local button = cas:BindAction("ExtraFireButton", buttonPressFunction, true)
cas:SetPosition("ExtraFireButton", UDim2.new(0.58,0,0.15,0))
I discovery out how to “say” is the mouse, but I don’t know how to “say” to function what it should do.
local cas = game:GetService("ContextActionService")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local RemoteEvent = game.ReplicatedStorage.Mobile.Fire
local UserInputService = game:GetService("UserInputService")
local function buttonPressFunction()
UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
end
local button = cas:BindAction("ExtraFireButton", buttonPressFunction, true,Enum.UserInputType.MouseButton1)