Long story short I have been following MapleGalaxy’s tutorial and seem to not be able to get beyond this issue and I currently see no work arounds to it due to this being Region3, if I just removed it the hitbox might act a little bit funky, so yeah.
repeat wait() until Player.Character
Character = Player.Character
mouse = Player:GetMouse()
Enabled = true
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, IsTyping)
if IsTyping then
return
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
if Enabled == true then
script.Function:FireServer("Combat", Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2).p)
end
end
end)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HRP")
local Mouse = Player:GetMouse()
local Enabled = true
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local RE = RS:WaitForChild("Function")
UIS.InputBegan:Connect(function(Input, Processed)
if Processed then
return
end
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
if Enabled then
local CFrames = HRP.CFrame * CFrame.new(0, 0, -2)
RE:FireServer("Combat", CFrames)
end
end
end)
Move the RemoteEvent instance named “Function” to the ReplicatedStorage folder and try the above script.