Open source project - Source engine clone v1 (gm_flatgrass classic)

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

files for the thumbnail:
game icon.pdn (2.0 MB)

thumbnail.pdn (2.1 MB)

Moon Animator AnimSaves are in ServerStorage

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

5 Likes

Pretty nice item you made. Good job.

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? :face_with_raised_eyebrow:

(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)
1 Like

okay i published an update to the place with that fix, thanks!

please make bhopping work (i tried unlocking the max speed) i wanna implement it and im not much of a good coder

1 Like