Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there other better ways other than using Mouse.TargetSurface?

local p = script.Parent.Parent.Parent
local r = script.Parent.RemoteEvent

local function o (p,t,ts)
    local pt = Instance.new("Part")
    pt.Size = Vector3.new(4,4,4)
    if ts == Enum.NormalId.Top then
	    pt.Position = t.Position + Vector3.new(0,4,0)
    else
	    if ts == Enum.NormalId.Bottom then
		    pt.Position = t.Position + Vector3.new(0,-4,0)
	    else
		    if ts == Enum.NormalId.Front then
			    pt.Position = t.Position + Vector3.new(0,0,-4)
			else
			    if ts == Enum.NormalId.Back then
				    pt.Position = t.Position + Vector3.new(0,0,4)
			    else
				    if ts == Enum.NormalId.Left then
					    pt.Position = t.Position + Vector3.new(-4,0,0)
				    else
					    if ts == Enum.NormalId.Right then
						    pt.Position = t.Position + Vector3.new(4,0,0)
					    end
				    end
			    end
		    end
	    end
    end
    pt.Anchored = true
    pt.Parent = workspace
end

r.OnServerEvent:Connect(o)

I'm using Mouse.TargetSurface to get the right position.

1 answer

✓ Accepted answer

I just saw an answer, vector3.FromNormalId(). Sorry for the trouble

This discussion is preserved as it was. New answers, comments, and votes are closed.