local player = script.Parent.Parent
local mouse = player:GetMouse()
local dirt = game.ServerStorage.DirtBlock:Clone()
-- Surface Values
local right = 0
local top = 1
local back = 2
local left = 3
local bottom = 4
local front = 5
--
mouse.Button1Down:connect(function()
local t = mouse.Target
print'fired 1'
if mouse.TargetSurface == front then
print'fired 2'
dirt.Parent = workspace
dirt.Position = t.Position + Vector3.new(3,0,0)
end
end)
COMMUNITY QUESTION
'fired 1' fires but not 'fired 2'?
1 answer
Why are you checking if the targetsurface is a number value? Shouldn't it be a surface type such as "Front" or "Top"?
3 comments
0
TargetSurface is a NormalId, which is always a number value if you look at the wiki page.
0
Use comments
0
Ah, just assumed it was a string. Didn't bother checking on my phone
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Try comparing to "Enum.NormalId.Front" rather than a variable named "front"
line 12 is a comment
It just appears like that because of the website. It's not a comment in the actual script.