Skip to content

Hitmarkers

Hitmarkers are a fairly easy to set up for your DynamicCrosshair! You are able to fully customize your hitmarker along with a headshot feature.

Examples

Customization

Calling The Hitmarker Function
local UI : ScreenGui = ...
local DynamicCrosshair = require(...).New(UI)
DynamicCrosshair:Enable()

-- all customization settings:

DynamicCrosshair.HitMarker.size = UDim2.fromOffset(50, 50) -- UDim2 Value
DynamicCrosshair.HitMarker.default = Color3.fromRGB(255, 255, 255) -- Color3 Value
DynamicCrosshair.HitMarker.headshot = Color3.fromRGB(255, 0, 0) -- Color3 Value
DynamicCrosshair.HitMarker.fadeTime = 0.25 -- Number Value
DynamicCrosshair.HitMarker.easingStyle = Enum.EasingStyle.Linear
DynamicCrosshair.HitMarker.easingDirection = Enum.EasingDirection.InOut

-- Change The Image:

DynamicCrosshair.HitMarker.Image.default = 'rbxassetid://...'
DynamicCrosshair.HitMarker.Image.headshot = 'rbxassetid://...'

Note

If the HitMarker.Image.headshot value is left nil it will default to HitMarker.Image.default

Functionality

Lets now call the actual Hitmarker function. This function takes a headshot parameter. If the headshot image is not nil, the hitmarker will display the given image.

Calling The Hitmarker Function
1
2
3
4
5
6
7
8
9
local UI : ScreenGui = ...
local DynamicCrosshair = require(...).New(UI)
DynamicCrosshair:Enable()

--DyanmicCrosshair:Hitmarker( headshot : boolean )
-- all the following functions will work:
DynamicCrosshair:Hitmarker() -- headshot is false
DyanmicCrosshair:Hitmarker(false) -- headshot is false
DynamicCrosshair:Hitmarker(true) -- headshot is true