Since I am rewriting this from the ground up for a better version, I thought I would open source the old version. This version doesnt include everything I aimed to include
Beware of jankiness with swimming
HUD texture files are taken from HL1 (non source) per-aniversary update (the main one is 640hud7)
Uses HdrZones and Iris
please credit me if you use it
edit 6/2/2025: im bored so im trying to revive the Flatgrass Classic project, the new version wont be uncopylocked for the forseeable future so I updated the place link
Unsure what this game is about, since you haven’t specified. But, there’s a bug:
If you click, your tool is activated. When you let go of your mouse, it is activated again. Are you using ContextActionService incorrectly? Did you forget to check if the state is Begin?
(edit): Yes! You need to check if the state is Begin, or else you will swing for any state.
Another bug which this code has that I didn’t see at first: All mouse button 1 inputs sink here inappropriately, since it only swings when that if statement is true.
The fixed code is as follows:
ContextActionService:BindAction("action1", function(_, state: Enum.UserInputState, input: InputObject)
if state == Enum.UserInputState.Begin and p.character and deathMessage == "" and math.abs(a-tick()) > 0.15 then
a = tick()
swing:Play()
action1:FireServer(CurrentItem,mouse.Hit.Position, mouse.Target,camera.CFrame)
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end, true, Enum.UserInputType.MouseButton1)
ContextActionService:BindAction("action2", function(_, state: Enum.UserInputState, input: InputObject)
if state == Enum.UserInputState.Begin and p.character and deathMessage == "" and math.abs(a-tick()) > 0.15 then
a = tick()
action2:FireServer(items[CurrentItem],mouse.Hit.Position, mouse.Target)
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end, true, Enum.UserInputType.MouseButton2)