#need help scripting a gun
1 messages · Page 1 of 1 (latest)
here let me get chatGPT
i do not think chatgpt will help
we will see
local script in the tool "local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local shootEvent = tool:WaitForChild("ShootEvent")
tool.Equipped:Connect(function()
mouse.Button1Down:Connect(function()
if mouse and mouse.Hit then
local position = mouse.Hit.Position
shootEvent:FireServer(position)
end
end)
end)
"
and make a remote event
keep in mind this is super bare bones
but i tested it it works